diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..f160ba0f0 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 981176a1c..6512117d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef6b62406..352a68725 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 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 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