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
+ TARGET_OS=${TARGET_OS} \
73
+ TARGET_ARCH=${TARGET_ARCH} \
74
+ ./scripts/build-release-single-target ${{ env.RELEASE_VERSION }}
23
75
env :
24
76
GITHUB_REPOSITORY : ${{ github.repository }}
25
77
- name : Calculate checksums
@@ -29,13 +81,13 @@ jobs:
29
81
run : ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
30
82
- uses : actions/upload-artifact@v4
31
83
with :
32
- name : etcd_output
84
+ name : etcd_output_amd64
33
85
path : release/
34
86
release :
35
87
permissions :
36
88
contents : write
37
89
runs-on : ubuntu-latest
38
- needs : build
90
+ needs : [ build-amd64, build-arm64]
39
91
outputs :
40
92
upload_url : ${{ steps.create_release_branch.outputs.upload_url }}${{ steps.create_release_tags.outputs.upload_url }}
41
93
steps :
@@ -86,9 +138,18 @@ jobs:
86
138
platform : ["linux-arm64","linux-amd64"]
87
139
extension : ["tar.gz"]
88
140
steps :
89
- - uses : actions/download-artifact@v4
141
+ - name : Set artifact name
142
+ id : set_artifact
143
+ run : |
144
+ if [[ "${{ matrix.platform }}" == *"arm64"* ]]; then
145
+ echo "ARTIFACT_NAME=etcd_output_arm64" >> $GITHUB_ENV
146
+ else
147
+ echo "ARTIFACT_NAME=etcd_output_amd64" >> $GITHUB_ENV
148
+ fi
149
+ - name : Download artifacts
150
+ uses : actions/download-artifact@v4
90
151
with :
91
- name : etcd_output
152
+ name : ${{ env.ARTIFACT_NAME }}
92
153
path : _output/release-tars
93
154
github-token : ${{ secrets.GITHUB_TOKEN }}
94
155
- name : Set release version environment variable
@@ -112,11 +173,16 @@ jobs:
112
173
runs-on : ubuntu-latest
113
174
needs : release
114
175
steps :
115
- - uses : actions/download-artifact@v4
176
+ - name : Create output directory
177
+ run : mkdir -p _output/checksums
178
+ - name : Download all artifacts
179
+ uses : actions/download-artifact@v4
116
180
with :
117
- name : etcd_output
118
- path : _output/checksums
181
+ path : _output/artifacts
119
182
github-token : ${{ secrets.GITHUB_TOKEN }}
183
+ - name : Combine checksums
184
+ run : |
185
+ find _output/artifacts -name "SHA256SUMS" -exec cat {} \; > _output/checksums/SHA256SUMS
120
186
- name : Upload checksums
121
187
id : upload-checksums
122
188
uses : actions/upload-release-asset@v1
0 commit comments