v0.1.1 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| tags: ["v*.*.*"] | |
| workflow_dispatch: | |
| inputs: | |
| releaseTag: | |
| description: Existing git tag (i.e. v0.1.0) | |
| required: true | |
| dryRun: | |
| description: Dryrun | |
| default: "true" | |
| type: choice | |
| options: | |
| - "true" | |
| - "false" | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_type == 'tag')) | |
| outputs: | |
| RELEASE_TAG: ${{ steps.check-tag.outputs.RELEASE_TAG }} | |
| REPO_NAME: ${{ steps.check-tag.outputs.REPO_NAME }} | |
| steps: | |
| - name: Check release tag | |
| id: check-tag | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| console.log('github.event_name', '${{ github.event_name }}') | |
| console.log('github.ref_type', '${{ github.ref_type }}') | |
| let releaseTag | |
| if('${{ github.event_name }}' == 'workflow_dispatch') { | |
| releaseTag = '${{ github.event.inputs.releaseTag }}' | |
| } else if('${{ github.event_name }}' == 'push' && '${{ github.ref_type }}' == 'tag') { | |
| releaseTag = '${{ github.ref }}'.replace(/^refs\/tags\//, ''); | |
| } else { | |
| console.log('no semver tag found') | |
| return | |
| } | |
| console.log('RELEASE_TAG', releaseTag) | |
| core.setOutput('RELEASE_TAG', releaseTag) | |
| console.log('REPO_NAME', context.repo.repo) | |
| core.setOutput('REPO_NAME', context.repo.repo) | |
| - name: Check tag semver | |
| id: check-tag-semver | |
| uses: madhead/semver-utils@36d1e0ed361bd7b4b77665de8093092eaeabe6ba # v4.3.0 - latest as of 2025-04-27 | |
| if: ${{ steps.check-tag.outputs.RELEASE_TAG != '' }} | |
| with: | |
| version: ${{ steps.check-tag.outputs.RELEASE_TAG }} | |
| lenient: false # fail on error | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: check | |
| if: ${{ needs.check.outputs.RELEASE_TAG != '' }} | |
| steps: | |
| - name: Make a release | |
| uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2 - latest as of 2025-04-27 | |
| if: github.event.inputs.dryRun != 'true' | |
| with: | |
| tag_name: ${{ needs.check.outputs.RELEASE_TAG }} |