Skip to content

Commit 5cef52e

Browse files
committed
action: create release together with binaries
1 parent 88cb167 commit 5cef52e

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create release
1+
name: Build & Release
22

33
on:
44
push:
@@ -9,19 +9,6 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
release:
13-
runs-on: ubuntu-22.04
14-
steps:
15-
- name: Create release
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
tag: ${{ github.ref_name }}
19-
run: |
20-
gh release create "$tag" \
21-
--repo="$GITHUB_REPOSITORY" \
22-
--title="$tag" \
23-
--generate-notes
24-
2512
build:
2613
name: Build (${{ matrix.distro.name }})
2714
runs-on: ubuntu-latest
@@ -87,10 +74,26 @@ jobs:
8774
cp "dist/${BIN_NAME}" "out/${BIN_NAME}-${{ matrix.distro.suffix }}"
8875
chmod +x "out/${BIN_NAME}-${{ matrix.distro.suffix }}"
8976
90-
- name: Upload binaries to GitHub Release
91-
env:
92-
tag: ${{ github.ref_name }}
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
run: |
95-
gh release upload "$tag" out/** \
96-
--repo="$GITHUB_REPOSITORY"
77+
- name: Upload artifact
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: ${{ matrix.distro.suffix }}
81+
path: out/*
82+
83+
release:
84+
name: Create release & upload binaries
85+
runs-on: ubuntu-latest
86+
needs: build
87+
steps:
88+
- name: Download all build artifacts
89+
uses: actions/download-artifact@v4
90+
with:
91+
path: dist_out
92+
93+
- name: Publish GitHub Release
94+
uses: softprops/action-gh-release@v2
95+
with:
96+
tag_name: ${{ github.ref_name }}
97+
files: |
98+
dist_out/**/*
99+
generate_release_notes: true

0 commit comments

Comments
 (0)