📦 Release patch/1.4.0-beta.1 by @wayjam (🧪 Dry-Run) #2
This file contains 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: 0x📦 Release New Version | |
run-name: 📦 Release ${{ inputs.semver }}/${{ inputs.custom_version }} by @${{ github.actor }} ${{ inputs.dry_run && '(🧪 Dry-Run)' || '' }} | |
on: | |
workflow_dispatch: | |
inputs: | |
semver: | |
type: choice | |
description: Which version you want to increment? | |
options: | |
- patch | |
- minor | |
- major | |
required: true | |
custom_version: | |
description: Manual Custom Version (Special Purpose, e.g. 1.0.0) | |
type: string | |
required: false | |
dry_run: | |
description: "Dry run?" | |
type: boolean | |
default: false | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Calc Version | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
default_bump: ${{ inputs.semver }} | |
custom_tag: ${{ inputs.custom_version }} | |
dry_run: 'true' | |
- name: Bump version and push tag | |
if: inputs.dry_run == false | |
uses: reedyuk/npm-version@1.1.1 | |
with: | |
version: ${{ steps.tag_version.outputs.new_version }} | |
git-tag-version: 'true' | |
- name: Create a GitHub release | |
if: inputs.dry_run == false | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
draft: ${{ inputs.dry_run }} | |
- name: Dispatch Build | |
uses: benc-uk/workflow-dispatch@v1 | |
if: inputs.dry_run == false | |
with: | |
workflow: publish.yml |