Skip to content

Commit a3f03eb

Browse files
committed
fix: split release workflow into build and release stages
1 parent 0fafe5b commit a3f03eb

2 files changed

Lines changed: 39 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
release:
12+
build:
1313
strategy:
1414
fail-fast: false
1515
matrix:
@@ -43,7 +43,40 @@ jobs:
4343
- name: Build Electron app
4444
run: pnpm --filter @codingcode/desktop run build
4545

46-
- name: Package & publish
47-
run: pnpm --filter @codingcode/desktop exec electron-builder --${{ matrix.platform }} --publish always
46+
- name: Package (no publish)
47+
run: pnpm --filter @codingcode/desktop exec electron-builder --${{ matrix.platform }} --publish never
48+
49+
- name: Upload build artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: dist-${{ matrix.platform }}
53+
path: |
54+
packages/desktop/dist/*.exe
55+
packages/desktop/dist/*.exe.blockmap
56+
packages/desktop/dist/*.yml
57+
packages/desktop/dist/*.dmg
58+
packages/desktop/dist/*.zip
59+
packages/desktop/dist/*.AppImage
60+
if-no-files-found: warn
61+
62+
release:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Download all artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
path: assets
73+
merge-multiple: true
74+
75+
- name: Create GitHub Release and upload assets
4876
env:
4977
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: |
79+
gh release create "${{ github.ref_name }}" \
80+
--title "${{ github.ref_name }}" \
81+
--generate-notes \
82+
assets/*

packages/codingcode/test/ci/tooling-scripts.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ describe('CI tooling configuration', () => {
4949
expect(content).toContain('permissions:');
5050
expect(content).toContain('contents: write');
5151
expect(content).toContain('GH_TOKEN');
52-
expect(content).toContain('--publish always');
52+
expect(content).toContain('--publish never');
53+
expect(content).toContain('gh release create');
54+
expect(content).toContain('needs: build');
5355
});
5456

5557
it('electron-builder.yml has publish config for GitHub Releases', () => {

0 commit comments

Comments
 (0)