Skip to content

Commit

Permalink
feat: Refactor workflows to use implicit calling
Browse files Browse the repository at this point in the history
  • Loading branch information
dusansimic committed Mar 3, 2024
1 parent 35e5eb8 commit 8335098
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Build and publish

on:
push:
tags:
- '*'
workflow_run:
workflows: [Tests]
types: completed

jobs:
tests:
uses: ./.github/workflows/tests.yml
build:
needs: [tests]
runs-on: ${{ matrix.os }}
if: github.event.workflow_run.conclusion == 'success' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
strategy:
matrix:
os:
Expand All @@ -17,19 +17,21 @@ jobs:
- windows-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: 'npm'

- name: Install Snapcraft
# TODO: Bump after we're sure it works with samuelmeuli/action-electron-builder@v1
uses: samuelmeuli/action-snapcraft@v1
if: startsWith(matrix.os, 'ubuntu')

- name: Build & publish Caprine
# TODO: Upgrade action in fork https://github.com/dusansimic/action-electron-builder
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: 'npm'

- name: Run tests
Expand Down

0 comments on commit 8335098

Please sign in to comment.