Skip to content

Commit 15e1542

Browse files
authored
CM-71916 change workflow to support non-tag releases when needed (#528)
1 parent bf2d31f commit 15e1542

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/build_executable.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
required: false
99
default: false
1010
type: boolean
11+
confirm_non_release:
12+
description: 'I know this ref is not a release tag (required for non-tag refs)'
13+
required: false
14+
default: false
15+
type: boolean
1116
push:
1217
branches:
1318
- main
@@ -34,6 +39,12 @@ jobs:
3439
shell: bash
3540

3641
steps:
42+
- name: Verify non-tag dispatch is acknowledged
43+
if: ${{ github.event_name == 'workflow_dispatch' && github.ref_type != 'tag' && !inputs.confirm_non_release }}
44+
run: |
45+
echo "::error::Ref '${{ github.ref_name }}' is not a tag. Re-run with 'I know this ref is not a release tag' checked."
46+
exit 1
47+
3748
- name: Run Cimon
3849
if: matrix.os == 'ubuntu-22.04'
3950
uses: cycodelabs/cimon-action@a0870cc3d9e3bf3cedd28bdb67bf3fd3281e5941 # v1.0.1
@@ -52,13 +63,6 @@ jobs:
5263
with:
5364
fetch-depth: 0
5465

55-
- name: Checkout latest release tag
56-
if: ${{ github.event_name == 'workflow_dispatch' }}
57-
run: |
58-
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
59-
git checkout $LATEST_TAG
60-
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
61-
6266
- name: Set up Python 3.13
6367
id: setup-python
6468
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
@@ -343,6 +347,6 @@ jobs:
343347
uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # v2
344348
with:
345349
file: dist/*
346-
tag: ${{ env.LATEST_TAG }}
350+
tag: ${{ github.ref_name }}
347351
overwrite: true
348352
file_glob: true

0 commit comments

Comments
 (0)