Manual Release 0.11.1 #39
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: "Manual release" | |
| run-name: "Manual Release ${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" | |
| concurrency: release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| major: | |
| { description: SemVer major, required: true, type: number, default: 0 } | |
| minor: { description: SemVer minor, required: true, type: number } | |
| patch: | |
| { description: SemVer patch, required: true, type: number, default: 0 } | |
| env: | |
| VERSION: "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Create release | |
| run: | | |
| set +e | |
| gh release view ${{ env.VERSION }} --json name --jq '.name' | |
| HAS_NO_RELEASE=$? # error == exitcode 1 == no release of given version exists | |
| if (( $HAS_NO_RELEASE == 0 )); then | |
| echo "Release already exists, skipping." >> "$GITHUB_STEP_SUMMARY" | |
| else | |
| echo "Release does not exist, creating a new one" >> "$GITHUB_STEP_SUMMARY" | |
| gh release create ${{ env.VERSION }} \ | |
| --title "Cataclysm-BN ${{ env.VERSION }}" \ | |
| --draft \ | |
| --prerelease \ | |
| --generate-notes \ | |
| --target ${{ github.sha }} | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| builds: | |
| needs: release | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| version-label: "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" | |
| upload-to-release: true | |
| release-tag: "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" | |
| secrets: inherit |