From 384e0dc116a04103b8d63f470412951a9cb79cad Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:03:03 -0500 Subject: [PATCH 1/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/build.yml | 77 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 83 ++++------------------------------- .github/workflows/release.yml | 20 ++------- 3 files changed, 89 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..9fb07ec83 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +name: Build + +on: + workflow_call: + +jobs: + build-macos: + name: Build macOS (electron-builder) + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + - run: pnpm install + - run: pnpm build + - run: pnpm prepare:remove-source-maps + - run: pnpm package:macos --publish=never -c.mac.identity=null + env: + CSC_LINK: ${{ secrets.mac_certs }} + CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }} + - name: Clean up builds + run: rm -rfv dist/mac-universal + - uses: actions/upload-artifact@v4 + with: + name: Gitify-dist-mac + path: dist/ + overwrite: true + + build-windows: + name: Build Windows (electron-builder) + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + - run: pnpm install + - run: pnpm build + - run: pnpm prepare:remove-source-maps + - run: pnpm package:win --publish=never + - name: Clean up builds + run: Remove-Item dist/win-unpacked -Recurse + - uses: actions/upload-artifact@v4 + with: + name: Gitify-dist-win + path: dist + overwrite: true + + build-linux: + name: Build Linux (electron-builder) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + - run: pnpm install + - run: pnpm build + - run: pnpm prepare:remove-source-maps + - run: pnpm package:linux --publish=never + - name: Clean up builds + run: rm -rfv dist/linux-unpacked + - uses: actions/upload-artifact@v4 + with: + name: Gitify-dist-linux + path: dist + overwrite: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 981176a1c..d23d7f19e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,80 +20,15 @@ jobs: needs: lint if: ${{ !startsWith(github.head_ref, 'release/v') }} - build-macos: - name: Build macOS (electron-builder) - runs-on: macos-latest + build: + name: Build + uses: ./.github/workflows/build.yml needs: tests if: ${{ !startsWith(github.head_ref, 'release/v') }} - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - run: pnpm install - - run: pnpm build - - run: pnpm prepare:remove-source-maps - - run: pnpm package:macos --publish=never -c.mac.identity=null - env: - CSC_LINK: ${{ secrets.mac_certs }} - CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }} - - name: Clean up builds - run: rm -rfv dist/mac-universal - - uses: actions/upload-artifact@v4 - with: - name: Gitify-dist-mac - path: dist/ - overwrite: true - - build-windows: - name: Build Windows (electron-builder) - runs-on: windows-latest - needs: tests - if: ${{ !startsWith(github.head_ref, 'release/v') }} - - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - run: pnpm install - - run: pnpm build - - run: pnpm prepare:remove-source-maps - - run: pnpm package:win --publish=never - - name: Clean up builds - run: Remove-Item dist/win-unpacked -Recurse - - uses: actions/upload-artifact@v4 - with: - name: Gitify-dist-win - path: dist - overwrite: true - - build-linux: - name: Build Linux (electron-builder) - runs-on: ubuntu-latest - needs: tests - if: ${{ !startsWith(github.head_ref, 'release/v') }} - - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 - - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - run: pnpm install - - run: pnpm build - - run: pnpm prepare:remove-source-maps - - run: pnpm package:linux --publish=never - - name: Clean up builds - run: rm -rfv dist/linux-unpacked - - uses: actions/upload-artifact@v4 - with: - name: Gitify-dist-linux - path: dist - overwrite: true + release: + name: Release + uses: ./.github/workflows/release.yml + needs: build + if: ${{ startsWith(github.head_ref, 'release/v') }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef6b62406..af8949499 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,16 @@ name: Release -on: - push: - branches: - - 'release/v**' - workflow_dispatch: # For manually running release process to verify codesigning of artifacts +on: + workflow_call: + workflow_dispatch: # For manually running release process to verify code-signing of artifacts permissions: contents: write jobs: - lint: - name: Lint App - uses: ./.github/workflows/lint.yml - - tests: - name: Tests - uses: ./.github/workflows/test.yml - needs: lint - release-macos: name: Publish macOS (electron-builder) runs-on: macos-latest - needs: tests steps: - uses: actions/checkout@v4 @@ -55,7 +43,6 @@ jobs: release-windows: name: Publish Windows (electron-builder) runs-on: windows-latest - needs: tests steps: - uses: actions/checkout@v4 @@ -82,7 +69,6 @@ jobs: release-linux: name: Publish Linux (electron-builder) runs-on: ubuntu-latest - needs: tests steps: - uses: actions/checkout@v4 From 097ad281776a70b7954cc659634a0e4dead1560b Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:06:45 -0500 Subject: [PATCH 2/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d23d7f19e..b6b4bcfe5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,11 @@ jobs: lint: name: Lint App uses: ./.github/workflows/lint.yml - if: ${{ !startsWith(github.head_ref, 'release/v') }} tests: name: Tests uses: ./.github/workflows/test.yml needs: lint - if: ${{ !startsWith(github.head_ref, 'release/v') }} build: name: Build From e3753c1d086a2f8f29fefa4e4523ccf050024413 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:08:12 -0500 Subject: [PATCH 3/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/triage.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 724057c32..681cd59c4 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -2,8 +2,13 @@ name: Triage PR on: pull_request: - types: [opened, edited, synchronize, ready_for_review] - branches: [main] + types: + - opened + - edited + - synchronize + - ready_for_review + branches: + - main permissions: contents: read # the config file From a90622839b29f54fe64c3d1da9b3864aa39ffb54 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:12:09 -0500 Subject: [PATCH 4/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6b4bcfe5..745eac140 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ jobs: release: name: Release uses: ./.github/workflows/release.yml - needs: build + needs: tests + permissions: + contents: write if: ${{ startsWith(github.head_ref, 'release/v') }} From e224d05bfa9425d6a652449a807eb11b7e95c411 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:19:15 -0500 Subject: [PATCH 5/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/build.yml | 3 +++ .github/workflows/ci.yml | 2 -- .github/workflows/release.yml | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fb07ec83..f160ba0f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,7 @@ jobs: build-macos: name: Build macOS (electron-builder) runs-on: macos-latest + if: ${{ !startsWith(github.head_ref, 'release/v') }} steps: - uses: actions/checkout@v4 @@ -33,6 +34,7 @@ jobs: build-windows: name: Build Windows (electron-builder) runs-on: windows-latest + if: ${{ !startsWith(github.head_ref, 'release/v') }} steps: - uses: actions/checkout@v4 @@ -56,6 +58,7 @@ jobs: build-linux: name: Build Linux (electron-builder) runs-on: ubuntu-latest + if: ${{ !startsWith(github.head_ref, 'release/v') }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 745eac140..6512117d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,6 @@ jobs: name: Build uses: ./.github/workflows/build.yml needs: tests - if: ${{ !startsWith(github.head_ref, 'release/v') }} release: name: Release @@ -30,5 +29,4 @@ jobs: needs: tests permissions: contents: write - if: ${{ startsWith(github.head_ref, 'release/v') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af8949499..352a68725 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,7 @@ jobs: release-macos: name: Publish macOS (electron-builder) runs-on: macos-latest + if: ${{ startsWith(github.head_ref, 'release/v') }} steps: - uses: actions/checkout@v4 @@ -43,6 +44,7 @@ jobs: release-windows: name: Publish Windows (electron-builder) runs-on: windows-latest + if: ${{ startsWith(github.head_ref, 'release/v') }} steps: - uses: actions/checkout@v4 @@ -69,6 +71,7 @@ jobs: release-linux: name: Publish Linux (electron-builder) runs-on: ubuntu-latest + if: ${{ startsWith(github.head_ref, 'release/v') }} steps: - uses: actions/checkout@v4 From b902efe945fdce9269cfe50b1de230ebeddcb1a2 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:23:28 -0500 Subject: [PATCH 6/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6512117d8..aa5564695 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,21 +10,21 @@ on: jobs: lint: - name: Lint App + name: ๐Ÿ” Lint App uses: ./.github/workflows/lint.yml tests: - name: Tests + name: ๐Ÿงช Tests uses: ./.github/workflows/test.yml needs: lint build: - name: Build + name: ๐Ÿ—๏ธ Build uses: ./.github/workflows/build.yml needs: tests release: - name: Release + name: ๐Ÿš€ Release uses: ./.github/workflows/release.yml needs: tests permissions: From c404aa6ef2c69dae6796c9acd97ecbf7bee02786 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:24:28 -0500 Subject: [PATCH 7/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa5564695..6512117d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,21 +10,21 @@ on: jobs: lint: - name: ๐Ÿ” Lint App + name: Lint App uses: ./.github/workflows/lint.yml tests: - name: ๐Ÿงช Tests + name: Tests uses: ./.github/workflows/test.yml needs: lint build: - name: ๐Ÿ—๏ธ Build + name: Build uses: ./.github/workflows/build.yml needs: tests release: - name: ๐Ÿš€ Release + name: Release uses: ./.github/workflows/release.yml needs: tests permissions: From e9e178dfc4a0f55fdf0380e42d3d6427b93574c8 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 14 Jan 2025 07:25:42 -0500 Subject: [PATCH 8/8] refactor: action trigger logic Signed-off-by: Adam Setch --- .github/workflows/website.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index d5537f6af..f851df95e 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -1,4 +1,4 @@ -name: Update Website +name: Website on: push: @@ -7,8 +7,8 @@ on: jobs: redeploy-website: + name: Deploy Website runs-on: ubuntu-latest steps: - - name: Redeploy Website - run: curl -X POST -d {} ${{ secrets.NETLIFY_BUILD_HOOK_URL }} + - run: curl -X POST -d {} ${{ secrets.NETLIFY_BUILD_HOOK_URL }} \ No newline at end of file