-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Try to make mediasoup-worker-prebuild CI task only run in releases #1280
Changes from 3 commits
61a6458
afb0bf3
b29c494
36322c3
6539414
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: mediasoup-worker-prebuild | |
|
||
on: | ||
push: | ||
branches: | ||
- v3 | ||
# Only trigger for production releases. | ||
tags: | ||
- "*.*.*" | ||
|
@@ -15,7 +17,7 @@ on: | |
jobs: | ||
ci: | ||
strategy: | ||
fail-fast: false | ||
fail-fast: true | ||
matrix: | ||
build: | ||
# For Linux let's use an old version of Ubuntu (20.04) that builds the | ||
|
@@ -44,29 +46,36 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
if: startsWith(github.ref, "refs/tags/") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not skipping the whole workflow instead? Skipping individual steps looks odd There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How to do that? 😀 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is But if job is only triggered by tag, this check doesn't have any effect in the first place. |
||
|
||
- name: Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
if: startsWith(github.ref, "refs/tags/") | ||
|
||
# We need to install some NPM production deps for npm-scripts.mjs to work. | ||
- name: npm ci --ignore-scripts | ||
run: npm ci --ignore-scripts --omit=dev --foreground-scripts | ||
if: startsWith(github.ref, "refs/tags/") | ||
|
||
# However we also need to install pip invoke manually (since | ||
# `--ignore-scripts` prevented invoke from being installed). | ||
- name: pip3 install invoke | ||
run: pip3 install invoke | ||
if: startsWith(github.ref, "refs/tags/") | ||
|
||
- name: npm run worker:build | ||
run: npm run worker:build | ||
if: startsWith(github.ref, "refs/tags/") | ||
|
||
# Publish prebuild binaries on tag. | ||
- name: npm run worker:prebuild | ||
run: npm run worker:prebuild | ||
if: startsWith(github.ref, "refs/tags/") | ||
|
||
- name: Upload mediasoup-worker prebuilt binary | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: worker/prebuild/mediasoup-worker-*.tgz | ||
if: startsWith(github.ref, "refs/tags/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add
v3
branch if you only want to run this workflow on releases? I believe these conditions are additive.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did assuming they are not additive...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you're right, the documentation isn've very clear about this: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore