Skip to content

refactor: action trigger logic #1722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build

on:
workflow_call:

jobs:
build-macos:
name: Build macOS (electron-builder)
runs-on: macos-latest
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
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
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
85 changes: 9 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,88 +12,21 @@ 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-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
release:
name: Release
uses: ./.github/workflows/release.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: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
permissions:
contents: write

23 changes: 6 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
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
if: ${{ startsWith(github.head_ref, 'release/v') }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -55,7 +44,7 @@ jobs:
release-windows:
name: Publish Windows (electron-builder)
runs-on: windows-latest
needs: tests
if: ${{ startsWith(github.head_ref, 'release/v') }}

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

steps:
- uses: actions/checkout@v4
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update Website
name: Website

on:
push:
Expand All @@ -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 }}

Loading