Skip to content

Commit

Permalink
ci: Update semantic release to only run on workflow dispatch
Browse files Browse the repository at this point in the history
Signed-off-by: David Hart <[email protected]>
  • Loading branch information
dbhart authored Nov 4, 2024
1 parent c417fa9 commit 71ff868
Showing 1 changed file with 13 additions and 26 deletions.
39 changes: 13 additions & 26 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
name: Semantic Release

on:
push:
branches:
- main

workflow_dispatch:
inputs:
releaseType:
description: 'The type of release'
required: false
default: ''
type: choice
options:
- ''
- prerelease
- release
force:
description: "Force a bump to a specific version"
is_prerelease:
description: 'Is this a prerelease?'
required: false
default: ""
type: choice
options: ["", "prerelease", "patch", "minor", "major"]
default: true
type: boolean

permissions:
contents: read
Expand All @@ -31,7 +17,9 @@ jobs:
name: >-
🔖❓ - Check if release needed
runs-on: ubuntu-latest
concurrency: semanticRelease
environment:
name: release
concurrency: release
# Only run if this is the primary origin main branch
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'sandialabs/sansmic' }}
outputs:
Expand All @@ -50,8 +38,7 @@ jobs:
- name: Debug
run: |
echo "## Inputs" >> $GITHUB_STEP_SUMMARY
echo ${{ inputs.releaseType }} | tee $GITHUB_STEP_SUMMARY
echo ${{ inputs.force }} | tee $GITHUB_STEP_SUMMARY
echo "Is prerelease - " ${{ inputs.is_prerelease }} | tee $GITHUB_STEP_SUMMARY
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -64,6 +51,7 @@ jobs:
id: vars
run: |
echo "short_sha=$(git rev-parse --short HEAD)\n" >> $GITHUB_OUTPUT
- name: Action | Semantic Release - Update version
id: semVer
# Adjust tag with desired version if applicable.
Expand All @@ -77,9 +65,9 @@ jobs:
commit: true
push: true
tag: false
prerelease: ${{ ! (inputs.releaseType == 'release') }}
force: ${{ inputs.force }}
prerelease: ${{ inputs.is_prerelease }}
vcs_release: false

- name: Action | Output version info
run: |
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -191,7 +179,7 @@ jobs:
- build_wheels
environment:
name: release
concurrency: semanticRelease
concurrency: release

permissions:
id-token: write
Expand Down Expand Up @@ -252,8 +240,7 @@ jobs:
commit: false
push: true
tag: true
prerelease: ${{ ! (inputs.releaseType == 'release') }}
force: ${{ inputs.force }}
prerelease: ${{ inputs.is_prerelease }}
vcs_release: true

- name: Publish | Upload to GitHub Release Assets
Expand Down

0 comments on commit 71ff868

Please sign in to comment.