Skip to content

Commit

Permalink
CI: Node.js compile on-demand workflow dispatch (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 26, 2023
1 parent 4239e0b commit 82e05e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/gh-release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ on:
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
group: ${{ github.workflow }}-${{ inputs.ref || github.head_ref || github.ref }}
cancel-in-progress: true

env:
ref: ${{ inputs.ref || github.sha || github.ref }}

jobs:
release:
runs-on: ubuntu-latest
env:
ref: ${{ inputs.ref || github.sha || github.ref }}
steps:
- uses: actions/checkout@v3
with:
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/node-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ on:
release:
types:
- published
workflow_dispatch:
inputs:
tag:
description: 'Tag (e.g. "v1.0.0")'
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
group: ${{ github.workflow }}-${{ inputs.tag || github.head_ref || github.ref }}
cancel-in-progress: true

env:
ref: ${{ inputs.tag && format('refs/tags/{0}',inputs.tag) || github.sha || github.ref }}

jobs:
path-filter:
runs-on: ubuntu-latest
Expand All @@ -24,6 +33,8 @@ jobs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.ref }}
- id: filter
uses: dorny/paths-filter@v2
with:
Expand All @@ -35,7 +46,7 @@ jobs:
node-compile:
needs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
if: ${{ needs.path-filter.outputs.changes == 'true' || github.event_name != 'pull_request' }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
Expand Down Expand Up @@ -97,6 +108,8 @@ jobs:
steps:
# Setup and install
- uses: actions/checkout@v3
with:
ref: ${{ env.ref }}
- if: matrix.os == 'ubuntu'
uses: docker/setup-qemu-action@v2
- uses: actions/setup-node@v3
Expand All @@ -116,13 +129,15 @@ jobs:
if-no-files-found: error

release-update:
if: github.event_name == 'release'
if: ${{ github.event_name != 'pull_request' }}
needs:
- node-compile
runs-on: ubuntu-latest
steps:
# Get the package version
- uses: actions/checkout@v3
with:
ref: ${{ env.ref }}
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
Expand Down

0 comments on commit 82e05e6

Please sign in to comment.