diff --git a/.github/actions/elk-tag-and-release/action.yaml b/.github/actions/elk-tag-and-release/action.yaml index ff22df7..9ddf0da 100644 --- a/.github/actions/elk-tag-and-release/action.yaml +++ b/.github/actions/elk-tag-and-release/action.yaml @@ -18,6 +18,14 @@ inputs: description: The file to use as the release body required: false default: '' + bump-type: + description: The type of bump to perform + required: false + default: 'minor' + custom-version: + description: A custom tag to use instead of bumping the version + required: false + default: '' dry-run: description: Whether to perform a dry run or not required: false @@ -46,6 +54,8 @@ runs: DRY_RUN: ${{ inputs.dry-run }} #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token WITH_V: 'true' + DEFAULT_BUMP: ${{ inputs.bump-type }} + CUSTOM_VERSION: ${{ inputs.custom-version }} - name: Extract major tag id: extract-major shell: bash @@ -57,12 +67,10 @@ runs: run: |- git config user.name github-actions git config user.email github-actions@github.com - if [[ "${{ inputs.dry-run }}" == "true" ]]; then echo "Dry run, not updating major tag" exit 0 fi - git tag --force ${{ steps.extract-major.outputs.major_tag }} \ ${{ steps.bump-version.outputs.new_tag }} git push origin ${{ steps.extract-major.outputs.major_tag }} --force diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml new file mode 100644 index 0000000..a1f7a86 --- /dev/null +++ b/.github/workflows/bump-version.yaml @@ -0,0 +1,37 @@ +name: Bump version + +on: + workflow_dispatch: # manually + inputs: + bump-type: + type: choice + required: true + description: "The kind of version bump to perform" + options: + - patch + - minor + - major + - custom version + custom-version: + type: string + description: "Custom version to use" + required: false + default: "" + + +permissions: + contents: write + +jobs: + tag-and-release: + name: Tag and Release + runs-on: ubuntu-latest + steps: + - name: Tag and Release + uses: elk-audio/.github/.github/actions/elk-tag-and-release@v1 + with: + bump-type: ${{ github.event.inputs.bump-type }} + custom-version: ${{ github.event.inputs.custom-version }} + + +