Skip to content

Commit

Permalink
feat: selector and custom version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
druskus20 committed Mar 7, 2024
1 parent 1d81c93 commit 294c062
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/actions/elk-tag-and-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
@@ -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 }}



0 comments on commit 294c062

Please sign in to comment.