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 : Set environment variables
58
+ id : set_env
59
+ run : |
60
+ echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
61
+ echo "TARGET_OS=$(echo ${{ matrix.platform }} | cut -d'/' -f1)" >> $GITHUB_ENV
62
+ echo "TARGET_ARCH=$(echo ${{ matrix.platform }} | cut -d'/' -f2)" >> $GITHUB_ENV
63
+ export GOEXPERIMENT=boringcrypto
64
+ - name : Build etcd
65
+ run : |
66
+ REPOSITORY=https://github.com/${{ env.GITHUB_REPOSITORY}}.git \
67
+ CGO_ENABLED=1 \
68
+ GO_BUILD_FLAGS="-tags=fips" \
69
+ TARGET_OS=${TARGET_OS} \
70
+ TARGET_ARCH=${TARGET_ARCH} \
71
+ ./scripts/build-release-single-target ${{ env.RELEASE_VERSION }}
23
72
env :
24
73
GITHUB_REPOSITORY : ${{ github.repository }}
25
74
- name : Calculate checksums
@@ -29,13 +78,13 @@ jobs:
29
78
run : ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
30
79
- uses : actions/upload-artifact@v4
31
80
with :
32
- name : etcd_output
81
+ name : etcd_output_amd64
33
82
path : release/
34
83
release :
35
84
permissions :
36
85
contents : write
37
86
runs-on : ubuntu-latest
38
- needs : build
87
+ needs : [ build-amd64, build-arm64]
39
88
outputs :
40
89
upload_url : ${{ steps.create_release_branch.outputs.upload_url }}${{ steps.create_release_tags.outputs.upload_url }}
41
90
steps :
@@ -86,9 +135,18 @@ jobs:
86
135
platform : ["linux-arm64","linux-amd64"]
87
136
extension : ["tar.gz"]
88
137
steps :
89
- - uses : actions/download-artifact@v4
138
+ - name : Set artifact name
139
+ id : set_artifact
140
+ run : |
141
+ if [[ "${{ matrix.platform }}" == *"arm64"* ]]; then
142
+ echo "ARTIFACT_NAME=etcd_output_arm64" >> $GITHUB_ENV
143
+ else
144
+ echo "ARTIFACT_NAME=etcd_output_amd64" >> $GITHUB_ENV
145
+ fi
146
+ - name : Download artifacts
147
+ uses : actions/download-artifact@v4
90
148
with :
91
- name : etcd_output
149
+ name : ${{ env.ARTIFACT_NAME }}
92
150
path : _output/release-tars
93
151
github-token : ${{ secrets.GITHUB_TOKEN }}
94
152
- name : Set release version environment variable
@@ -112,11 +170,16 @@ jobs:
112
170
runs-on : ubuntu-latest
113
171
needs : release
114
172
steps :
115
- - uses : actions/download-artifact@v4
173
+ - name : Create output directory
174
+ run : mkdir -p _output/checksums
175
+ - name : Download all artifacts
176
+ uses : actions/download-artifact@v4
116
177
with :
117
- name : etcd_output
118
- path : _output/checksums
178
+ path : _output/artifacts
119
179
github-token : ${{ secrets.GITHUB_TOKEN }}
180
+ - name : Combine checksums
181
+ run : |
182
+ find _output/artifacts -name "SHA256SUMS" -exec cat {} \; > _output/checksums/SHA256SUMS
120
183
- name : Upload checksums
121
184
id : upload-checksums
122
185
uses : actions/upload-release-asset@v1
0 commit comments