Skip to content

Commit 384e0dc

Browse files
committed
refactor: action trigger logic
Signed-off-by: Adam Setch <[email protected]>
1 parent c805994 commit 384e0dc

File tree

3 files changed

+89
-91
lines changed

3 files changed

+89
-91
lines changed

.github/workflows/build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-macos:
8+
name: Build macOS (electron-builder)
9+
runs-on: macos-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v3
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version-file: '.nvmrc'
17+
cache: 'pnpm'
18+
- run: pnpm install
19+
- run: pnpm build
20+
- run: pnpm prepare:remove-source-maps
21+
- run: pnpm package:macos --publish=never -c.mac.identity=null
22+
env:
23+
CSC_LINK: ${{ secrets.mac_certs }}
24+
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
25+
- name: Clean up builds
26+
run: rm -rfv dist/mac-universal
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: Gitify-dist-mac
30+
path: dist/
31+
overwrite: true
32+
33+
build-windows:
34+
name: Build Windows (electron-builder)
35+
runs-on: windows-latest
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: pnpm/action-setup@v3
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version-file: '.nvmrc'
43+
cache: 'pnpm'
44+
- run: pnpm install
45+
- run: pnpm build
46+
- run: pnpm prepare:remove-source-maps
47+
- run: pnpm package:win --publish=never
48+
- name: Clean up builds
49+
run: Remove-Item dist/win-unpacked -Recurse
50+
- uses: actions/upload-artifact@v4
51+
with:
52+
name: Gitify-dist-win
53+
path: dist
54+
overwrite: true
55+
56+
build-linux:
57+
name: Build Linux (electron-builder)
58+
runs-on: ubuntu-latest
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: pnpm/action-setup@v3
63+
- uses: actions/setup-node@v4
64+
with:
65+
node-version-file: '.nvmrc'
66+
cache: 'pnpm'
67+
- run: pnpm install
68+
- run: pnpm build
69+
- run: pnpm prepare:remove-source-maps
70+
- run: pnpm package:linux --publish=never
71+
- name: Clean up builds
72+
run: rm -rfv dist/linux-unpacked
73+
- uses: actions/upload-artifact@v4
74+
with:
75+
name: Gitify-dist-linux
76+
path: dist
77+
overwrite: true

.github/workflows/ci.yml

Lines changed: 9 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -20,80 +20,15 @@ jobs:
2020
needs: lint
2121
if: ${{ !startsWith(github.head_ref, 'release/v') }}
2222

23-
build-macos:
24-
name: Build macOS (electron-builder)
25-
runs-on: macos-latest
23+
build:
24+
name: Build
25+
uses: ./.github/workflows/build.yml
2626
needs: tests
2727
if: ${{ !startsWith(github.head_ref, 'release/v') }}
2828

29-
steps:
30-
- uses: actions/checkout@v4
31-
- uses: pnpm/action-setup@v3
32-
- uses: actions/setup-node@v4
33-
with:
34-
node-version-file: '.nvmrc'
35-
cache: 'pnpm'
36-
- run: pnpm install
37-
- run: pnpm build
38-
- run: pnpm prepare:remove-source-maps
39-
- run: pnpm package:macos --publish=never -c.mac.identity=null
40-
env:
41-
CSC_LINK: ${{ secrets.mac_certs }}
42-
CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }}
43-
- name: Clean up builds
44-
run: rm -rfv dist/mac-universal
45-
- uses: actions/upload-artifact@v4
46-
with:
47-
name: Gitify-dist-mac
48-
path: dist/
49-
overwrite: true
50-
51-
build-windows:
52-
name: Build Windows (electron-builder)
53-
runs-on: windows-latest
54-
needs: tests
55-
if: ${{ !startsWith(github.head_ref, 'release/v') }}
56-
57-
steps:
58-
- uses: actions/checkout@v4
59-
- uses: pnpm/action-setup@v3
60-
- uses: actions/setup-node@v4
61-
with:
62-
node-version-file: '.nvmrc'
63-
cache: 'pnpm'
64-
- run: pnpm install
65-
- run: pnpm build
66-
- run: pnpm prepare:remove-source-maps
67-
- run: pnpm package:win --publish=never
68-
- name: Clean up builds
69-
run: Remove-Item dist/win-unpacked -Recurse
70-
- uses: actions/upload-artifact@v4
71-
with:
72-
name: Gitify-dist-win
73-
path: dist
74-
overwrite: true
75-
76-
build-linux:
77-
name: Build Linux (electron-builder)
78-
runs-on: ubuntu-latest
79-
needs: tests
80-
if: ${{ !startsWith(github.head_ref, 'release/v') }}
81-
82-
steps:
83-
- uses: actions/checkout@v4
84-
- uses: pnpm/action-setup@v3
85-
- uses: actions/setup-node@v4
86-
with:
87-
node-version-file: '.nvmrc'
88-
cache: 'pnpm'
89-
- run: pnpm install
90-
- run: pnpm build
91-
- run: pnpm prepare:remove-source-maps
92-
- run: pnpm package:linux --publish=never
93-
- name: Clean up builds
94-
run: rm -rfv dist/linux-unpacked
95-
- uses: actions/upload-artifact@v4
96-
with:
97-
name: Gitify-dist-linux
98-
path: dist
99-
overwrite: true
29+
release:
30+
name: Release
31+
uses: ./.github/workflows/release.yml
32+
needs: build
33+
if: ${{ startsWith(github.head_ref, 'release/v') }}
34+

.github/workflows/release.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
name: Release
22

3-
on:
4-
push:
5-
branches:
6-
- 'release/v**'
7-
workflow_dispatch: # For manually running release process to verify codesigning of artifacts
3+
on:
4+
workflow_call:
5+
workflow_dispatch: # For manually running release process to verify code-signing of artifacts
86

97
permissions:
108
contents: write
119

1210
jobs:
13-
lint:
14-
name: Lint App
15-
uses: ./.github/workflows/lint.yml
16-
17-
tests:
18-
name: Tests
19-
uses: ./.github/workflows/test.yml
20-
needs: lint
21-
2211
release-macos:
2312
name: Publish macOS (electron-builder)
2413
runs-on: macos-latest
25-
needs: tests
2614

2715
steps:
2816
- uses: actions/checkout@v4
@@ -55,7 +43,6 @@ jobs:
5543
release-windows:
5644
name: Publish Windows (electron-builder)
5745
runs-on: windows-latest
58-
needs: tests
5946

6047
steps:
6148
- uses: actions/checkout@v4
@@ -82,7 +69,6 @@ jobs:
8269
release-linux:
8370
name: Publish Linux (electron-builder)
8471
runs-on: ubuntu-latest
85-
needs: tests
8672

8773
steps:
8874
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)