186 lines (183 loc) · 6.48 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: CI
on: [push, pull_request]
jobs:
build-test:
strategy:
matrix:
platform: [x64, x86]
runs-on: windows-latest
defaults:
run:
shell: bash --noprofile --norc -e -o pipefail -o igncr {0}
env:
PATH: C:\cygwin\bin
steps:
- name: Install Cygwin Git
uses: cygwin/cygwin-install-action@v2
with:
platform: ${{ matrix.platform }}
packages: git
timeout-minutes: 10
- name: Configure safe.directory # Workaround for actions/checkout#760
run: git config --global --add safe.directory '*'
timeout-minutes: 1
- name: Checkout
uses: actions/checkout@users/tihuang/setsafedirinput
with:
set-safe-directory: false
timeout-minutes: 1
- name: Load packages to install
id: cyg-package-list
run: |
printf '::set-output name=packages::'
tr '\n' ' ' <build-requires.txt
timeout-minutes: 1
- name: Install Cygwin build requirements
uses: cygwin/cygwin-install-action@v2
with:
platform: ${{ matrix.platform }}
packages: ${{ steps.cyg-package-list.outputs.packages }}
timeout-minutes: 30
- name: Generate cygcheck output
if: always()
run: cygcheck -srv >/var/log/cygcheck.out
timeout-minutes: 5
- name: Store Cygwin logs
if: always()
uses: actions/upload-artifact@v2
with:
name: cygwin-logs-${{ matrix.platform }}
path: 'C:\cygwin\var\log\'
timeout-minutes: 5
- name: Cygport download
run: cygport git.cygport download
timeout-minutes: 5
- name: Cygport prep
run: cygport git.cygport prep
timeout-minutes: 1
- name: Cygport compile
run: cygport git.cygport compile
timeout-minutes: 30
- name: Cygport test
if: false
run: cygport git.cygport test
timeout-minutes: 300
- name: Cygport install
run: cygport git.cygport install
timeout-minutes: 30
- name: Cygport package
run: cygport git.cygport package
timeout-minutes: 5
- name: Configure SSH
if: false
env:
MAINTAINER_KEY: ${{ secrets.MAINTAINER_KEY }}
run: |
umask 0077
mkdir -p ~/.ssh
echo "$MAINTAINER_KEY" >~/.ssh/id_rsa
echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts
timeout-minutes: 1
- name: Cygport stage
if: false
run: SSH_KEY=~/.ssh/id_rsa cygport git.cygport stage
timeout-minutes: 5
- name: Tar up build results
if: always()
run: tar -caf git-${{ matrix.platform }}.txz git-*-*.*/
timeout-minutes: 10
- name: Store build results
if: always()
uses: actions/upload-artifact@v2
with:
name: build-results-${{ matrix.platform }}
path: git-${{ matrix.platform }}.txz
if-no-files-found: error
timeout-minutes: 5
release:
needs: build-test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install lftp
run: |
sudo apt-get update
sudo apt-get install lftp
timeout-minutes: 5
- name: Checkout
uses: actions/checkout@users/tihuang/setsafedirinput
with:
fetch-depth: 0
timeout-minutes: 1
- name: Compute release name
id: release-name
run: |
eval $(grep -e '^VERSION=' -e '^RELEASE=' git.cygport)
printf '::set-output name=release::%s-%s' "$VERSION" "$RELEASE"
timeout-minutes: 1
- name: Download build results
uses: actions/download-artifact@v2
timeout-minutes: 5
- name: Unpack build results
run: |
tar -xaf build-results-x86/git-x86.txz
tar -xaf build-results-x64/git-x64.txz
timeout-minutes: 5
- name: Name release artifacts for the GitHub release
env:
PVR: ${{ steps.release-name.outputs.release }}
run: |
# Delete the source packages from the 32-bit build; we'll only use
# the ones that were generated from the 64-bit build, since they'll
# be identical unless something has gone very wrong.
rm git-"${PVR}".i686/dist/git/git-"${PVR}"-src.*
# Rename other files to specify the architecture.
for arch in i686 x86_64; do
(
cd git-"$PVR"."$arch"/dist/git
while read -r -d $'\0' file; do
mv "$file" "${file/${PVR}./${PVR}.${arch}.}"
done < <(find . -type f \! -name '*-src.*' -print0)
)
done
timeout-minutes: 1
- name: Create release tag
env:
GIT_COMMITTER_NAME: ${{ github.actor }}
GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
run: |
git tag -am 'v${{ steps.release-name.outputs.release }}' 'v${{ steps.release-name.outputs.release }}-test'
git push origin tag 'v${{ steps.release-name.outputs.release }}'
timeout-minutes: 1
- name: Create a GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.release-name.outputs.release }}
files: |
git-*/dist/git/*
git-*/dist/git/*/*
target_commitish: ${{ github.ref }}
draft: true
timeout-minutes: 2
- name: Configure SSH
env:
MAINTAINER_KEY: ${{ secrets.MAINTAINER_KEY }}
run: |
umask 0077
mkdir -p ~/.ssh
echo "$MAINTAINER_KEY" >~/.ssh/id_rsa
echo 'cygwin.com,8.43.85.97 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGqrxexIuyqmCVe33p1HuhUFzsXte5QZKb+BJlsRrvXOpUOJEW2S0kszyAiymeV7AXaYmHDKVRJpGVR+0ua0Xww=' >~/.ssh/known_hosts
timeout-minutes: 1
- name: Mirror to Cygwin Git repositories
if: false
run: git push cygwin@cygwin.com:/git/cygwin-packages/git 'v${{ steps.release-name.outputs.release }}'
timeout-minutes: 5
- name: Release on the Cygwin mirror
run: >
lftp -c 'set cmd:fail-exit on;
set cmd:interactive on;
set net:max-retries 1;
open sftp://cygwin:@cygwin.com;
ls;'
timeout-minutes: 5