Skip to content

Commit 83884e6

Browse files
committed
ci: fix duplicate artifact names
1 parent 8d177c4 commit 83884e6

File tree

2 files changed

+38
-90
lines changed

2 files changed

+38
-90
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ jobs:
5858
build-linux:
5959
runs-on: ubuntu-latest
6060
needs: [ test ]
61+
strategy:
62+
matrix:
63+
go-arch: [amd64, arm64]
6164
steps:
6265
- uses: actions/checkout@v4
6366
- uses: actions/setup-go@v5
@@ -68,36 +71,27 @@ jobs:
6871
sudo apt update
6972
sudo apt install -y gcc-aarch64-linux-gnu
7073
go generate ./...
71-
- name: Build amd64
74+
- name: Build ${{ matrix.go-arch }}
7275
env:
7376
CGO_ENABLED: 1
7477
GOOS: linux
75-
GOARCH: amd64
78+
GOARCH: ${{ matrix.go-arch }}
7679
run: |
7780
mkdir -p release
7881
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
7982
go build -tags='netgo' -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
8083
cp README.md LICENSE bin/
8184
zip -qj $ZIP_OUTPUT bin/*
82-
- name: Build arm64
83-
env:
84-
CGO_ENABLED: 1
85-
GOOS: linux
86-
GOARCH: arm64
87-
CC: aarch64-linux-gnu-gcc
88-
run: |
89-
mkdir -p release
90-
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
91-
go build -tags='netgo' -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/hostd
92-
cp README.md LICENSE bin/
93-
zip -qj $ZIP_OUTPUT bin/*
9485
- uses: actions/upload-artifact@v4
9586
with:
96-
name: hostd
97-
path: release/
87+
name: hostd-linux-${{ matrix.go-arch }}
88+
path: release/*
9889
build-mac:
9990
runs-on: macos-latest
10091
needs: [ test ]
92+
strategy:
93+
matrix:
94+
go-arch: [amd64, arm64]
10195
steps:
10296
- uses: actions/checkout@v4
10397
- uses: actions/setup-go@v5
@@ -139,27 +133,7 @@ jobs:
139133
140134
# resync system clock https://github.com/actions/runner/issues/2996#issuecomment-1833103110
141135
sudo sntp -sS time.windows.com
142-
- name: Build amd64
143-
env:
144-
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
145-
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
146-
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
147-
APPLE_KEY_B64: ${{ secrets.APPLE_KEY_B64 }}
148-
APPLE_CERT_B64: ${{ secrets.APPLE_CERT_B64 }}
149-
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
150-
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
151-
CGO_ENABLED: 1
152-
GOOS: darwin
153-
GOARCH: amd64
154-
run: |
155-
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
156-
mkdir -p release
157-
go build -tags='netgo' -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/hostd
158-
cp README.md LICENSE bin/
159-
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/hostd
160-
ditto -ck bin $ZIP_OUTPUT
161-
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
162-
- name: Build arm64
136+
- name: Build ${{ matrix.go-arch }}
163137
env:
164138
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
165139
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
@@ -170,7 +144,7 @@ jobs:
170144
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
171145
CGO_ENABLED: 1
172146
GOOS: darwin
173-
GOARCH: arm64
147+
GOARCH: ${{ matrix.go-arch }}
174148
run: |
175149
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
176150
mkdir -p release
@@ -181,8 +155,8 @@ jobs:
181155
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
182156
- uses: actions/upload-artifact@v4
183157
with:
184-
name: hostd
185-
path: release/
158+
name: hostd-darwin-${{ matrix.go-arch }}
159+
path: release/*
186160
build-windows:
187161
runs-on: windows-latest
188162
needs: [ test ]
@@ -211,8 +185,8 @@ jobs:
211185
7z a $ZIP_OUTPUT ./bin/*
212186
- uses: actions/upload-artifact@v4
213187
with:
214-
name: hostd
215-
path: release/
188+
name: hostd-windows-amd64
189+
path: release/*
216190

217191
dispatch-homebrew: # only runs on full releases
218192
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')

.github/workflows/publish_testnet.yml

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Publish - Testnet
22

3-
# Controls when the action will run.
3+
# Controls when the action will run.
44
on:
55
# Triggers the workflow on new SemVer tags
66
push:
77
branches:
88
- master
9-
tags:
9+
tags:
1010
- 'v[0-9]+.[0-9]+.[0-9]+'
1111
- 'v[0-9]+.[0-9]+.[0-9]+-**'
1212

@@ -60,6 +60,9 @@ jobs:
6060
build-linux:
6161
runs-on: ubuntu-latest
6262
needs: [ test ]
63+
strategy:
64+
matrix:
65+
go-arch: [amd64, arm64]
6366
steps:
6467
- uses: actions/checkout@v4
6568
- uses: actions/setup-go@v5
@@ -70,36 +73,27 @@ jobs:
7073
sudo apt update
7174
sudo apt install -y gcc-aarch64-linux-gnu
7275
go generate ./...
73-
- name: Build amd64
76+
- name: Build ${{ matrix.go-arch }}
7477
env:
7578
CGO_ENABLED: 1
7679
GOOS: linux
77-
GOARCH: amd64
80+
GOARCH: ${{ matrix.go-arch }}
7881
run: |
7982
mkdir -p release
8083
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
8184
go build -tags='testnet netgo' -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
8285
cp README.md LICENSE bin/
8386
zip -qj $ZIP_OUTPUT bin/*
84-
- name: Build arm64
85-
env:
86-
CGO_ENABLED: 1
87-
GOOS: linux
88-
GOARCH: arm64
89-
CC: aarch64-linux-gnu-gcc
90-
run: |
91-
mkdir -p release
92-
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
93-
GOOS=linux GOARCH=arm64 go build -tags='testnet netgo' -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
94-
cp README.md LICENSE bin/
95-
zip -qj $ZIP_OUTPUT bin/*
9687
- uses: actions/upload-artifact@v4
9788
with:
98-
name: hostd-zen
99-
path: release/
100-
build-mac:
89+
name: hostd-zen-linux-${{ matrix.go-arch }}
90+
path: release/*
91+
build-mac:
10192
runs-on: macos-latest
10293
needs: [ test ]
94+
strategy:
95+
matrix:
96+
go-arch: [amd64, arm64]
10397
steps:
10498
- uses: actions/checkout@v4
10599
- uses: actions/setup-go@v5
@@ -135,33 +129,13 @@ jobs:
135129
security import $APPLE_CERT_PATH -P $APPLE_CERT_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
136130
security find-identity -v $KEYCHAIN_PATH -p codesigning
137131
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
138-
132+
139133
# generate
140134
go generate ./...
141-
135+
142136
# resync system clock https://github.com/actions/runner/issues/2996#issuecomment-1833103110
143137
sudo sntp -sS time.windows.com
144-
- name: Build amd64
145-
env:
146-
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
147-
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
148-
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
149-
APPLE_KEY_B64: ${{ secrets.APPLE_KEY_B64 }}
150-
APPLE_CERT_B64: ${{ secrets.APPLE_CERT_B64 }}
151-
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
152-
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
153-
CGO_ENABLED: 1
154-
GOOS: darwin
155-
GOARCH: amd64
156-
run: |
157-
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
158-
mkdir -p release
159-
go build -tags='testnet netgo' -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/hostd
160-
cp README.md LICENSE bin/
161-
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/hostd
162-
ditto -ck bin $ZIP_OUTPUT
163-
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
164-
- name: Build arm64
138+
- name: Build ${{ matrix.go-arch }}
165139
env:
166140
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
167141
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
@@ -172,7 +146,7 @@ jobs:
172146
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
173147
CGO_ENABLED: 1
174148
GOOS: darwin
175-
GOARCH: arm64
149+
GOARCH: ${{ matrix.go-arch }}
176150
run: |
177151
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
178152
mkdir -p release
@@ -183,9 +157,9 @@ jobs:
183157
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
184158
- uses: actions/upload-artifact@v4
185159
with:
186-
name: hostd-zen
187-
path: release/
188-
build-windows:
160+
name: hostd-zen-darwin-${{ matrix.go-arch }}
161+
path: release/*
162+
build-windows:
189163
runs-on: windows-latest
190164
needs: [ test ]
191165
steps:
@@ -213,5 +187,5 @@ jobs:
213187
7z a $ZIP_OUTPUT ./bin/*
214188
- uses: actions/upload-artifact@v4
215189
with:
216-
name: hostd-zen
217-
path: release/
190+
name: hostd-zen-windows-amd64
191+
path: release/*

0 commit comments

Comments
 (0)