Skip to content

Commit dd3a420

Browse files
authored
Merge pull request #10 from AlessandroZanatta/main
feat: separate build and release jobs
2 parents 5abcd1f + eca0093 commit dd3a420

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
contents: write
1212

1313
jobs:
14-
release:
14+
build:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
@@ -69,24 +69,30 @@ jobs:
6969
ARCH: ${{ matrix.arch }}
7070
run: pnpm run make --arch=${{ matrix.arch }}
7171

72-
# Delete existing release if it exists
73-
- name: Delete existing release
74-
# but do this only once per job run
75-
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'macos-latest' && matrix.arch == 'arm64'
76-
uses: dev-drprasad/[email protected]
72+
- name: Upload artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: app-${{ matrix.os }}-${{ matrix.arch }}
76+
path: "out/**/*.zip"
77+
if-no-files-found: error
78+
79+
release:
80+
needs: build
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Download all uploaded artifacts
84+
uses: actions/download-artifact@v4
7785
with:
78-
tag_name: ${{ github.ref_name }}
79-
github_token: ${{ secrets.GITHUB_TOKEN }}
80-
delete_release: true
86+
path: ./downloaded-artifacts
8187

82-
# Create new release
83-
- name: Create Release
84-
uses: softprops/action-gh-release@v1
88+
- name: Create or update release
89+
uses: ncipollo/release-action@v1
8590
if: startsWith(github.ref, 'refs/tags/')
8691
with:
87-
files: |
88-
out/**/*.zip
92+
allowUpdates: true
93+
replacesArtifacts: true
94+
removeArtifacts: true
95+
artifacts: "downloaded-artifacts/**/*.zip"
8996
draft: false
9097
prerelease: false
91-
env:
92-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)