Skip to content

Commit 36b30b4

Browse files
committed
Run the test release process on new tag pushes.
1 parent 4d99a48 commit 36b30b4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/test_release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
schedule:
1212
# Run the second day of every month.
1313
- cron: "12 3 2 * *"
14+
push:
15+
tags:
16+
- '*'
1417

1518
env:
1619
# Change these for your project's URLs
@@ -22,9 +25,9 @@ jobs:
2225
check-branch:
2326
runs-on: ubuntu-latest
2427
steps:
25-
- name: Check if the branch is main
28+
- name: Check if the branch is main for workflow dispatches
2629
run: |
27-
if [ "${{ github.ref }}" != "refs/heads/main" ]; then
30+
if ["${{ github.event_name }}" == "workflow_dispatch"] && [ "${{ github.ref }}" != "refs/heads/main" ]; then
2831
echo "This workflow can only run on the main branch. Exiting."
2932
exit 0
3033
fi
@@ -58,7 +61,13 @@ jobs:
5861
fi
5962
- name: Output dev version
6063
id: output-dev-version
61-
run: echo "dev_version=${{ env.suffix }}${{ env.iteration }}" >> "$GITHUB_OUTPUT"
64+
# Don't output a dev version if the push was for a tag.
65+
run: |
66+
if [ ${{ startsWith(github.ref, 'refs/tags') }} ]; then
67+
echo "dev_version=''" >> "$GITHUB_OUTPUT"
68+
else
69+
echo "dev_version=${{ env.suffix }}${{ env.iteration }}" >> "$GITHUB_OUTPUT"
70+
fi
6271
6372
build:
6473
name: Build distribution 📦

0 commit comments

Comments
 (0)