Skip to content

Commit 75f08c1

Browse files
authored
refactor: action trigger logic (#1722)
* refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> * refactor: action trigger logic Signed-off-by: Adam Setch <[email protected]> --------- Signed-off-by: Adam Setch <[email protected]>
1 parent c805994 commit 75f08c1

File tree

5 files changed

+105
-98
lines changed

5 files changed

+105
-98
lines changed

.github/workflows/build.yml

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

.github/workflows/ci.yml

Lines changed: 9 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -12,88 +12,21 @@ jobs:
1212
lint:
1313
name: Lint App
1414
uses: ./.github/workflows/lint.yml
15-
if: ${{ !startsWith(github.head_ref, 'release/v') }}
1615

1716
tests:
1817
name: Tests
1918
uses: ./.github/workflows/test.yml
2019
needs: lint
21-
if: ${{ !startsWith(github.head_ref, 'release/v') }}
2220

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

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
26+
release:
27+
name: Release
28+
uses: ./.github/workflows/release.yml
5429
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
30+
permissions:
31+
contents: write
32+

.github/workflows/release.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
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
14+
if: ${{ startsWith(github.head_ref, 'release/v') }}
2615

2716
steps:
2817
- uses: actions/checkout@v4
@@ -55,7 +44,7 @@ jobs:
5544
release-windows:
5645
name: Publish Windows (electron-builder)
5746
runs-on: windows-latest
58-
needs: tests
47+
if: ${{ startsWith(github.head_ref, 'release/v') }}
5948

6049
steps:
6150
- uses: actions/checkout@v4
@@ -82,7 +71,7 @@ jobs:
8271
release-linux:
8372
name: Publish Linux (electron-builder)
8473
runs-on: ubuntu-latest
85-
needs: tests
74+
if: ${{ startsWith(github.head_ref, 'release/v') }}
8675

8776
steps:
8877
- uses: actions/checkout@v4

.github/workflows/triage.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ name: Triage PR
22

33
on:
44
pull_request:
5-
types: [opened, edited, synchronize, ready_for_review]
6-
branches: [main]
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- ready_for_review
10+
branches:
11+
- main
712

813
permissions:
914
contents: read # the config file

.github/workflows/website.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Update Website
1+
name: Website
22

33
on:
44
push:
@@ -7,8 +7,8 @@ on:
77

88
jobs:
99
redeploy-website:
10+
name: Deploy Website
1011
runs-on: ubuntu-latest
1112
steps:
12-
- name: Redeploy Website
13-
run: curl -X POST -d {} ${{ secrets.NETLIFY_BUILD_HOOK_URL }}
13+
- run: curl -X POST -d {} ${{ secrets.NETLIFY_BUILD_HOOK_URL }}
1414

0 commit comments

Comments
 (0)