-
Notifications
You must be signed in to change notification settings - Fork 2k
223 lines (222 loc) · 8.02 KB
/
release.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: Release
on:
push:
tags: '*'
env:
GOTOOLCHAIN: local
jobs:
build-windows:
name: Build Windows Assets
runs-on: windows-latest
strategy:
matrix:
go: ['1.22.x']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin "+${GITHUB_REF}:${GITHUB_REF}"
shell: bash
# We update the current tag as the checkout step turns annotated tags
# into lightweight ones by accident, breaking "git describe".
# See https://github.com/actions/checkout/issues/882 for details.
- uses: ruby/setup-ruby@v1
- run: gem install asciidoctor
- run: Rename-Item -Path C:\msys64 -NewName msys64-tmp -Force
# We move the MSYS2 installed for Ruby aside to prevent use of its Git,
# which does not honour the PATH we set to our built git-lfs binary.
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: mkdir -p "$HOME/go/bin"
shell: bash
- run: set GOPATH=%HOME%\go
- run: choco install -y InnoSetup
- run: choco install -y strawberryperl
- run: choco install -y zip
- run: choco install -y jq
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
shell: bash
- uses: git-for-windows/setup-git-for-windows-sdk@v1
with:
flavor: minimal
# We install the SDK so as to have access to the msgfmt.exe binary
# from the GNU gettext package.
- run: mkdir -p bin/releases
shell: bash
# We clear the TMPDIR set for Ruby so mktemp and Go use the same
# volume for temporary files.
- run: PATH="$HOME/go/bin:$PATH" GOARCH=amd64 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-amd64-$(git describe).zip
shell: bash
env:
FORCE_LOCALIZE: true
- run: PATH="$HOME/go/bin:$PATH" GOARCH=386 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-386-$(git describe).zip
shell: bash
env:
FORCE_LOCALIZE: true
- run: PATH="$HOME/go/bin:$PATH" GOARCH=arm64 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-arm64-$(git describe).zip
shell: bash
env:
FORCE_LOCALIZE: true
- run: env -u TMPDIR make release-windows-stage-1
shell: bash
env:
FORCE_LOCALIZE: true
- uses: azure/azure-code-signing-action@v0.3.1
with:
azure-tenant-id: ${{ secrets.SPN_GIT_LFS_SIGNING_TENANT_ID }}
azure-client-id: ${{ secrets.SPN_GIT_LFS_SIGNING_CLIENT_ID }}
azure-client-secret: ${{ secrets.SPN_GIT_LFS_SIGNING }}
endpoint: https://wus.codesigning.azure.net/
code-signing-account-name: GitHubInc
certificate-profile-name: GitHubInc
files-folder: ${{ github.workspace }}/tmp/stage1
files-folder-filter: exe
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- run: env -u TMPDIR make release-windows-stage-2
shell: bash
- uses: azure/azure-code-signing-action@v0.3.1
with:
azure-tenant-id: ${{ secrets.SPN_GIT_LFS_SIGNING_TENANT_ID }}
azure-client-id: ${{ secrets.SPN_GIT_LFS_SIGNING_CLIENT_ID }}
azure-client-secret: ${{ secrets.SPN_GIT_LFS_SIGNING }}
endpoint: https://wus.codesigning.azure.net/
code-signing-account-name: GitHubInc
certificate-profile-name: GitHubInc
files-folder: ${{ github.workspace }}/tmp/stage2
files-folder-filter: exe
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- run: env -u TMPDIR make release-windows-stage-3
shell: bash
- run: env -u TMPDIR make release-windows-rebuild
shell: bash
- uses: actions/upload-artifact@v4
with:
name: windows-assets
path: bin/releases
build-macos:
name: Build macOS Assets
runs-on: macos-latest
strategy:
matrix:
go: ['1.22.x']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin "+${GITHUB_REF}:${GITHUB_REF}"
- uses: ruby/setup-ruby@v1
- run: gem install asciidoctor
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: brew install gettext
- run: make release
env:
FORCE_LOCALIZE: true
- run: CERT_FILE="$HOME/cert.p12" make release-write-certificate
env:
CERT_CONTENTS: ${{secrets.MACOS_CERT_BASE64}}
- run: CERT_FILE="$HOME/cert.p12" make release-import-certificate
env:
CERT_PASS: ${{secrets.MACOS_CERT_PASS}}
- run: make release-darwin
env:
DARWIN_DEV_USER: ${{secrets.MACOS_DEV_USER}}
DARWIN_DEV_PASS: ${{secrets.MACOS_DEV_PASS}}
DARWIN_DEV_TEAM: ${{secrets.MACOS_DEV_TEAM}}
DARWIN_CERT_ID: ${{secrets.MACOS_CERT_ID}}
- uses: actions/upload-artifact@v4
with:
name: macos-assets
path: bin/releases
build-main:
name: Main Release Assets
needs:
- build-windows
- build-macos
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.22.x']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin "+${GITHUB_REF}:${GITHUB_REF}"
- uses: ruby/setup-ruby@v1
- run: gem install asciidoctor
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: sudo apt-get update && sudo apt-get -y install gettext libarchive-tools
env:
DEBIAN_FRONTEND: noninteractive
- uses: actions/download-artifact@v4
with:
name: windows-assets
path: windows-assets
- uses: actions/download-artifact@v4
with:
name: macos-assets
path: macos-assets
- run: CGO_ENABLED=0 make release
- run: rm -f bin/releases/*windows* bin/releases/*darwin*
- run: 'find windows-assets -name "*windows*" -type f | xargs -I{} mv {} bin/releases'
- run: 'find macos-assets -name "*darwin*" -type f | xargs -I{} mv {} bin/releases'
- run: script/upload --skip-verify $(git describe)
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
build-docker:
name: Build Linux Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin "+${GITHUB_REF}:${GITHUB_REF}"
- uses: ruby/setup-ruby@v1
- run: gem install packagecloud-ruby
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh)
- run: ./docker/run_dockers.bsh --prune
# If this is a pre-release tag, don't upload anything to packagecloud.
- run: '[ -z "${GITHUB_REF%%refs/tags/*-pre*}" ] || ./script/packagecloud.rb'
env:
PACKAGECLOUD_TOKEN: ${{secrets.PACKAGECLOUD_TOKEN}}
build-docker-cross:
name: Build Cross Linux packages
runs-on: ubuntu-latest
strategy:
matrix:
arch: [arm64]
container: [debian_12]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch origin "+${GITHUB_REF}:${GITHUB_REF}"
- uses: ruby/setup-ruby@v1
- run: gem install packagecloud-ruby
- run: |
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker.service
docker version -f '{{.Server.Experimental}}'
- uses: docker/setup-qemu-action@v3
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh --arch=$ARCH $CONTAINER)
env:
ARCH: ${{matrix.arch}}
CONTAINER: ${{matrix.container}}
- run: ./docker/run_dockers.bsh --prune --arch=$ARCH $CONTAINER
env:
ARCH: ${{matrix.arch}}
CONTAINER: ${{matrix.container}}
# If this is a pre-release tag, don't upload anything to packagecloud.
- run: '[ -z "${GITHUB_REF%%refs/tags/*-pre*}" ] || ./script/packagecloud.rb'
env:
PACKAGECLOUD_TOKEN: ${{secrets.PACKAGECLOUD_TOKEN}}