8
8
- " *-dd*"
9
9
permissions : write-all
10
10
jobs :
11
- build :
12
- runs-on : ubuntu-latest
11
+ build-arm64 :
12
+ runs-on : ubuntu-24.04-arm
13
+ strategy :
14
+ matrix :
15
+ platform : ["linux/arm64"]
13
16
steps :
14
17
- uses : actions/checkout@v4
15
18
with :
16
19
fetch-depth : 0
17
- - name : Set release version environment variable
18
- run : echo RELEASE_VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
20
+ - name : Set environment variables
21
+ id : set_env
22
+ run : |
23
+ echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
24
+ echo "TARGET_OS=$(echo ${{ matrix.platform }} | cut -d'/' -f1)" >> $GITHUB_ENV
25
+ echo "TARGET_ARCH=$(echo ${{ matrix.platform }} | cut -d'/' -f2)" >> $GITHUB_ENV
26
+ export GOEXPERIMENT=boringcrypto
19
27
env :
20
28
GITHUB_REF : ${{ github.ref }}
21
29
- name : Build etcd
22
- run : REPOSITORY=https://github.com/${{ env.GITHUB_REPOSITORY}}.git CGO_ENABLED=1 GOEXPERIMENT=boringcrypto ./scripts/build-binary ${{ env.RELEASE_VERSION }}
30
+ run : |
31
+ REPOSITORY=https://github.com/${{ env.GITHUB_REPOSITORY}}.git \
32
+ CGO_ENABLED=1 \
33
+ GO_BUILD_FLAGS="-tags=fips" \
34
+ TARGET_OS=${TARGET_OS} \
35
+ TARGET_ARCH=${TARGET_ARCH} \
36
+ ./scripts/build-release-single-target ${{ env.RELEASE_VERSION }}
37
+ env :
38
+ GITHUB_REPOSITORY : ${{ github.repository }}
39
+ - name : Calculate checksums
40
+ id : calculate_checksums
41
+ shell : bash
42
+ working-directory : release/
43
+ run : ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
44
+ - uses : actions/upload-artifact@v4
45
+ with :
46
+ name : etcd_output_arm64
47
+ path : release/
48
+ build-amd64 :
49
+ strategy :
50
+ matrix :
51
+ platform : ["linux/amd64"]
52
+ runs-on : ubuntu-latest
53
+ steps :
54
+ - uses : actions/checkout@v4
55
+ with :
56
+ fetch-depth : 0
57
+ - name : Install cross-compilation toolchain
58
+ run : |
59
+ sudo apt-get update
60
+ sudo apt-get install -y gcc-aarch64-linux-gnu
61
+ - name : Set environment variables
62
+ id : set_env
63
+ run : |
64
+ echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
65
+ echo "TARGET_OS=$(echo ${{ matrix.platform }} | cut -d'/' -f1)" >> $GITHUB_ENV
66
+ echo "TARGET_ARCH=$(echo ${{ matrix.platform }} | cut -d'/' -f2)" >> $GITHUB_ENV
67
+ export GOEXPERIMENT=boringcrypto
68
+ - name : Build etcd
69
+ run : |
70
+ REPOSITORY=https://github.com/${{ env.GITHUB_REPOSITORY}}.git \
71
+ CGO_ENABLED=1 \
72
+ GO_BUILD_FLAGS="-tags=fips" \
73
+ TARGET_OS=${TARGET_OS} \
74
+ TARGET_ARCH=${TARGET_ARCH} \
75
+ ./scripts/build-release-single-target ${{ env.RELEASE_VERSION }}
23
76
env :
24
77
GITHUB_REPOSITORY : ${{ github.repository }}
25
78
- name : Calculate checksums
@@ -29,13 +82,13 @@ jobs:
29
82
run : ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
30
83
- uses : actions/upload-artifact@v4
31
84
with :
32
- name : etcd_output
85
+ name : etcd_output_amd64
33
86
path : release/
34
87
release :
35
88
permissions :
36
89
contents : write
37
90
runs-on : ubuntu-latest
38
- needs : build
91
+ needs : [ build-amd64, build-arm64]
39
92
outputs :
40
93
upload_url : ${{ steps.create_release_branch.outputs.upload_url }}${{ steps.create_release_tags.outputs.upload_url }}
41
94
steps :
@@ -86,9 +139,18 @@ jobs:
86
139
platform : ["linux-arm64","linux-amd64"]
87
140
extension : ["tar.gz"]
88
141
steps :
89
- - uses : actions/download-artifact@v4
142
+ - name : Set artifact name
143
+ id : set_artifact
144
+ run : |
145
+ if [[ "${{ matrix.platform }}" == *"arm64"* ]]; then
146
+ echo "ARTIFACT_NAME=etcd_output_arm64" >> $GITHUB_ENV
147
+ else
148
+ echo "ARTIFACT_NAME=etcd_output_amd64" >> $GITHUB_ENV
149
+ fi
150
+ - name : Download artifacts
151
+ uses : actions/download-artifact@v4
90
152
with :
91
- name : etcd_output
153
+ name : ${{ env.ARTIFACT_NAME }}
92
154
path : _output/release-tars
93
155
github-token : ${{ secrets.GITHUB_TOKEN }}
94
156
- name : Set release version environment variable
@@ -112,11 +174,16 @@ jobs:
112
174
runs-on : ubuntu-latest
113
175
needs : release
114
176
steps :
115
- - uses : actions/download-artifact@v4
177
+ - name : Create output directory
178
+ run : mkdir -p _output/checksums
179
+ - name : Download all artifacts
180
+ uses : actions/download-artifact@v4
116
181
with :
117
- name : etcd_output
118
- path : _output/checksums
182
+ path : _output/artifacts
119
183
github-token : ${{ secrets.GITHUB_TOKEN }}
184
+ - name : Combine checksums
185
+ run : |
186
+ find _output/artifacts -name "SHA256SUMS" -exec cat {} \; > _output/checksums/SHA256SUMS
120
187
- name : Upload checksums
121
188
id : upload-checksums
122
189
uses : actions/upload-release-asset@v1
0 commit comments