Skip to content
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

CI: Node.js compile on-demand workflow dispatch #628

Merged
merged 3 commits into from
Aug 26, 2023
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
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
Loading