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_ADDITIONAL_VARS="GOEXPERIMENT=boringcrypto" \
34
+ GO_BUILD_FLAGS="-tags=fips" \
35
+ TARGET_OS=${TARGET_OS} \
36
+ TARGET_ARCH=${TARGET_ARCH} \
37
+ ./scripts/build-release-single-target ${{ env.RELEASE_VERSION }}
38
+ env :
39
+ GITHUB_REPOSITORY : ${{ github.repository }}
40
+ - name : Calculate checksums
41
+ id : calculate_checksums
42
+ shell : bash
43
+ working-directory : release/
44
+ run : ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
45
+ - uses : actions/upload-artifact@v4
46
+ with :
47
+ name : etcd_output_arm64
48
+ path : release/
49
+ build-amd64 :
50
+ strategy :
51
+ matrix :
52
+ platform : ["linux/amd64"]
53
+ runs-on : ubuntu-latest
54
+ steps :
55
+ - uses : actions/checkout@v4
56
+ with :
57
+ fetch-depth : 0
58
+ - name : Set environment variables
59
+ id : set_env
60
+ run : |
61
+ echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
62
+ echo "TARGET_OS=$(echo ${{ matrix.platform }} | cut -d'/' -f1)" >> $GITHUB_ENV
63
+ echo "TARGET_ARCH=$(echo ${{ matrix.platform }} | cut -d'/' -f2)" >> $GITHUB_ENV
64
+ export GOEXPERIMENT=boringcrypto
65
+ - name : Build etcd
66
+ run : |
67
+ REPOSITORY=https://github.com/${{ env.GITHUB_REPOSITORY}}.git \
68
+ CGO_ENABLED=1 \
69
+ GO_ADDITIONAL_VARS="GOEXPERIMENT=boringcrypto" \
70
+ GO_BUILD_FLAGS="-tags=fips" \
71
+ TARGET_OS=${TARGET_OS} \
72
+ TARGET_ARCH=${TARGET_ARCH} \
73
+ ./scripts/build-release-single-target ${{ env.RELEASE_VERSION }}
23
74
env :
24
75
GITHUB_REPOSITORY : ${{ github.repository }}
25
76
- name : Calculate checksums
@@ -29,13 +80,13 @@ jobs:
29
80
run : ls . | grep -E '\.tar.gz$|\.zip$' | xargs shasum -a 256 > ./SHA256SUMS
30
81
- uses : actions/upload-artifact@v4
31
82
with :
32
- name : etcd_output
83
+ name : etcd_output_amd64
33
84
path : release/
34
85
release :
35
86
permissions :
36
87
contents : write
37
88
runs-on : ubuntu-latest
38
- needs : build
89
+ needs : [ build-amd64, build-arm64]
39
90
outputs :
40
91
upload_url : ${{ steps.create_release_branch.outputs.upload_url }}${{ steps.create_release_tags.outputs.upload_url }}
41
92
steps :
@@ -86,18 +137,24 @@ jobs:
86
137
platform : ["linux-arm64","linux-amd64"]
87
138
extension : ["tar.gz"]
88
139
steps :
89
- - uses : actions/download-artifact@v4
140
+ - name : Set artifact name
141
+ id : set_artifact
142
+ run : |
143
+ if [[ "${{ matrix.platform }}" == *"arm64"* ]]; then
144
+ echo "ARTIFACT_NAME=etcd_output_arm64" >> $GITHUB_ENV
145
+ else
146
+ echo "ARTIFACT_NAME=etcd_output_amd64" >> $GITHUB_ENV
147
+ fi
148
+ - name : Download artifacts
149
+ uses : actions/download-artifact@v4
90
150
with :
91
- name : etcd_output
151
+ name : ${{ env.ARTIFACT_NAME }}
92
152
path : _output/release-tars
93
153
github-token : ${{ secrets.GITHUB_TOKEN }}
94
154
- name : Set release version environment variable
95
155
run : echo RELEASE_VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
96
156
env :
97
157
GITHUB_REF : ${{ github.ref }}
98
- - name : Display structure of downloaded files
99
- run : ls -R
100
- working-directory : _output
101
158
- name : Upload Release Asset
102
159
id : upload-release-asset
103
160
uses : actions/upload-release-asset@v1
@@ -112,11 +169,16 @@ jobs:
112
169
runs-on : ubuntu-latest
113
170
needs : release
114
171
steps :
115
- - uses : actions/download-artifact@v4
172
+ - name : Create output directory
173
+ run : mkdir -p _output/checksums
174
+ - name : Download all artifacts
175
+ uses : actions/download-artifact@v4
116
176
with :
117
- name : etcd_output
118
- path : _output/checksums
177
+ path : _output/artifacts
119
178
github-token : ${{ secrets.GITHUB_TOKEN }}
179
+ - name : Combine checksums
180
+ run : |
181
+ find _output/artifacts -name "SHA256SUMS" -exec cat {} \; > _output/checksums/SHA256SUMS
120
182
- name : Upload checksums
121
183
id : upload-checksums
122
184
uses : actions/upload-release-asset@v1
0 commit comments