Skip to content

Commit

Permalink
ci: fix duplicate artifact names
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed May 7, 2024
1 parent 8d177c4 commit 83884e6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 90 deletions.
58 changes: 16 additions & 42 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
build-linux:
runs-on: ubuntu-latest
needs: [ test ]
strategy:
matrix:
go-arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -68,36 +71,27 @@ jobs:
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
go generate ./...
- name: Build amd64
- name: Build ${{ matrix.go-arch }}
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
GOARCH: ${{ matrix.go-arch }}
run: |
mkdir -p release
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
go build -tags='netgo' -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: arm64
CC: aarch64-linux-gnu-gcc
run: |
mkdir -p release
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
go build -tags='netgo' -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/hostd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v4
with:
name: hostd
path: release/
name: hostd-linux-${{ matrix.go-arch }}
path: release/*
build-mac:
runs-on: macos-latest
needs: [ test ]
strategy:
matrix:
go-arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -139,27 +133,7 @@ jobs:
# resync system clock https://github.com/actions/runner/issues/2996#issuecomment-1833103110
sudo sntp -sS time.windows.com
- name: Build amd64
env:
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_KEY_B64: ${{ secrets.APPLE_KEY_B64 }}
APPLE_CERT_B64: ${{ secrets.APPLE_CERT_B64 }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: |
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
mkdir -p release
go build -tags='netgo' -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/hostd
cp README.md LICENSE bin/
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/hostd
ditto -ck bin $ZIP_OUTPUT
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- name: Build arm64
- name: Build ${{ matrix.go-arch }}
env:
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
Expand All @@ -170,7 +144,7 @@ jobs:
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
CGO_ENABLED: 1
GOOS: darwin
GOARCH: arm64
GOARCH: ${{ matrix.go-arch }}
run: |
ZIP_OUTPUT=release/hostd_${GOOS}_${GOARCH}.zip
mkdir -p release
Expand All @@ -181,8 +155,8 @@ jobs:
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: hostd
path: release/
name: hostd-darwin-${{ matrix.go-arch }}
path: release/*
build-windows:
runs-on: windows-latest
needs: [ test ]
Expand Down Expand Up @@ -211,8 +185,8 @@ jobs:
7z a $ZIP_OUTPUT ./bin/*
- uses: actions/upload-artifact@v4
with:
name: hostd
path: release/
name: hostd-windows-amd64
path: release/*

dispatch-homebrew: # only runs on full releases
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
Expand Down
70 changes: 22 additions & 48 deletions .github/workflows/publish_testnet.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Publish - Testnet

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on new SemVer tags
push:
branches:
- master
tags:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-**'

Expand Down Expand Up @@ -60,6 +60,9 @@ jobs:
build-linux:
runs-on: ubuntu-latest
needs: [ test ]
strategy:
matrix:
go-arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -70,36 +73,27 @@ jobs:
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
go generate ./...
- name: Build amd64
- name: Build ${{ matrix.go-arch }}
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
GOARCH: ${{ matrix.go-arch }}
run: |
mkdir -p release
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
go build -tags='testnet netgo' -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: arm64
CC: aarch64-linux-gnu-gcc
run: |
mkdir -p release
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
GOOS=linux GOARCH=arm64 go build -tags='testnet netgo' -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/hostd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v4
with:
name: hostd-zen
path: release/
build-mac:
name: hostd-zen-linux-${{ matrix.go-arch }}
path: release/*
build-mac:
runs-on: macos-latest
needs: [ test ]
strategy:
matrix:
go-arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -135,33 +129,13 @@ jobs:
security import $APPLE_CERT_PATH -P $APPLE_CERT_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security find-identity -v $KEYCHAIN_PATH -p codesigning
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
# generate
go generate ./...
# resync system clock https://github.com/actions/runner/issues/2996#issuecomment-1833103110
sudo sntp -sS time.windows.com
- name: Build amd64
env:
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_KEY_B64: ${{ secrets.APPLE_KEY_B64 }}
APPLE_CERT_B64: ${{ secrets.APPLE_CERT_B64 }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: |
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
mkdir -p release
go build -tags='testnet netgo' -trimpath -o bin/ -a -ldflags '-s -w' ./cmd/hostd
cp README.md LICENSE bin/
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/hostd
ditto -ck bin $ZIP_OUTPUT
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- name: Build arm64
- name: Build ${{ matrix.go-arch }}
env:
APPLE_CERT_ID: ${{ secrets.APPLE_CERT_ID }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
Expand All @@ -172,7 +146,7 @@ jobs:
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
CGO_ENABLED: 1
GOOS: darwin
GOARCH: arm64
GOARCH: ${{ matrix.go-arch }}
run: |
ZIP_OUTPUT=release/hostd_zen_${GOOS}_${GOARCH}.zip
mkdir -p release
Expand All @@ -183,9 +157,9 @@ jobs:
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: hostd-zen
path: release/
build-windows:
name: hostd-zen-darwin-${{ matrix.go-arch }}
path: release/*
build-windows:
runs-on: windows-latest
needs: [ test ]
steps:
Expand Down Expand Up @@ -213,5 +187,5 @@ jobs:
7z a $ZIP_OUTPUT ./bin/*
- uses: actions/upload-artifact@v4
with:
name: hostd-zen
path: release/
name: hostd-zen-windows-amd64
path: release/*

0 comments on commit 83884e6

Please sign in to comment.