-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from dokku/bump-version
feat: add workflow to bump version in ci
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: "bump-version" | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bump_type: | ||
description: "Bump type" | ||
default: "patch" | ||
required: true | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
env: | ||
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
bump-version: | ||
name: bump-version | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ env.GITHUB_ACCESS_TOKEN }} | ||
|
||
- name: Get Latest Tag | ||
id: latest-tag | ||
run: | | ||
echo GIT_LATEST_TAG="$(git describe --tags "$(git rev-list --tags --max-count=1)")" >>"$GITHUB_OUTPUT" | ||
- name: Compute Next Tag | ||
id: next-tag | ||
uses: docker://ghcr.io/dokku/semver-generator:latest | ||
with: | ||
bump: ${{ github.event.inputs.bump_type }} | ||
input: ${{ steps.latest-tag.outputs.GIT_LATEST_TAG }} | ||
|
||
- name: Create and Push Tag | ||
run: | | ||
git config --global user.name 'Dokku Bot' | ||
git config --global user.email [email protected] | ||
git tag "$GIT_NEXT_TAG" | ||
git push origin "$GIT_NEXT_TAG" | ||
env: | ||
GIT_NEXT_TAG: ${{ steps.next-tag.outputs.version }} |