Skip to content

Commit 0a59efa

Browse files
authored
ci: fix release workflow (#93)
* release not triggered by pull_request * simplify release job * --all-features
1 parent cd07d91 commit 0a59efa

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
push:
44
tags:
55
- "*"
6-
pull_request:
76

87
jobs:
98
build:
@@ -36,7 +35,7 @@ jobs:
3635
# Regular build for non-MUSL targets
3736
- name: Build (non-MUSL)
3837
if: matrix.name != 'linux-musl'
39-
run: cargo build --release --locked
38+
run: cargo build --release --all-features --locked
4039

4140
# Native MUSL build using Alpine Docker
4241
- name: Build (MUSL)
@@ -47,7 +46,7 @@ jobs:
4746
apk add --no-cache musl-dev binutils g++
4847
4948
# Build the project
50-
cargo build --release --locked
49+
cargo build --release --all-features --locked
5150
'
5251
5352
- name: "Upload assets"
@@ -106,44 +105,44 @@ jobs:
106105
./ic-wasm --version
107106
108107
publish:
109-
# Check if the workflow was triggered by a tag
110-
if: startsWith(github.ref, 'refs/tags/')
111-
needs: test
112-
name: Publish ${{ matrix.asset_name }}
113-
strategy:
114-
fail-fast: false
115-
matrix:
116-
include:
117-
- asset_name: ic-wasm-linux64
118-
binstall_name: ic-wasm-x86_64-unknown-linux-gnu.tar.gz
119-
- asset_name: ic-wasm-linux-musl
120-
binstall_name: ic-wasm-x86_64-unknown-linux-musl.tar.gz
121-
- asset_name: ic-wasm-macos
122-
binstall_name: ic-wasm-x86_64-apple-darwin.tar.gz
108+
name: GitHub Release
123109
runs-on: ubuntu-latest
110+
needs: test
124111
steps:
125-
- name: Get executable
112+
- name: Get executables
126113
uses: actions/download-artifact@v4
127-
with:
128-
name: ${{ matrix.asset_name }}
129-
130-
- name: Upload binaries to release
131-
uses: svenstaro/upload-release-action@v2
132-
with:
133-
repo_token: ${{ secrets.GITHUB_TOKEN }}
134-
file: ic-wasm
135-
asset_name: ${{ matrix.asset_name }}
136-
tag: ${{ github.ref }}
114+
# Download all artifacts, files will be at:
115+
# ic-wasm-linux64/ic-wasm
116+
# ic-wasm-linux-musl/ic-wasm
117+
# ic-wasm-macos/ic-wasm
137118

138-
- name: Bundle for binstall
119+
- name: Prepare artifacts
139120
run: |
121+
mkdir artifacts
122+
123+
pushd ic-wasm-linux64
124+
chmod +x ic-wasm
125+
tar -cvzf ic-wasm-x86_64-unknown-linux-gnu.tar.gz ic-wasm
126+
mv ic-wasm ic-wasm-linux64
127+
mv * ../artifacts
128+
popd
129+
130+
pushd ic-wasm-linux-musl
131+
chmod +x ic-wasm
132+
tar -cvzf ic-wasm-x86_64-unknown-linux-musl.tar.gz ic-wasm
133+
mv ic-wasm ic-wasm-linux-musl
134+
mv * ../artifacts
135+
popd
136+
137+
pushd ic-wasm-macos
140138
chmod +x ic-wasm
141-
tar -cvzf ${{ matrix.binstall_name }} ic-wasm
139+
tar -cvzf ic-wasm-x86_64-apple-darwin.tar.gz ic-wasm
140+
mv ic-wasm ic-wasm-macos
141+
mv * ../artifacts
142+
popd
142143
143-
- name: Upload binstall binaries to release
144-
uses: svenstaro/upload-release-action@v2
144+
- name: Create GitHub Release
145+
uses: softprops/action-gh-release@v2
145146
with:
146-
repo_token: ${{ secrets.GITHUB_TOKEN }}
147-
file: ${{ matrix.binstall_name }}
148-
asset_name: ${{ matrix.binstall_name }}
149-
tag: ${{ github.ref }}
147+
token: ${{ secrets.GITHUB_TOKEN }}
148+
files: artifacts/*

0 commit comments

Comments
 (0)