0.3.2 #33
Workflow file for this run
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: Version Bump | |
on: | |
release: | |
types: | |
- created | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Latest Commit | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '18' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Output before version | |
id: get-before-version | |
shell: bash | |
run: echo "::set-output name=before-version::$(.github/scripts/get-version.sh)" | |
- name: Bump Version | |
run: .github/scripts/version-bump.sh | |
shell: bash | |
- name: Set outputs | |
id: get-outputs | |
shell: bash | |
env: | |
BEFORE_VERSION: ${{ steps.get-outputs.outputs.version }} | |
run: | | |
echo "::set-output name=version::$(.github/scripts/get-version.sh)" | |
echo "::set-output name=bumped::$(.github/scripts/src/bumped.sh)" | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v7 | |
id: cpr | |
with: | |
token: ${{ secrets.ORG_BOT_TOKEN }} | |
commit-message: "Bump version from ${{ steps.get-before-version.outputs.before-version }} to ${{ steps.get-outputs.outputs.version }}" | |
title: "Bump version from ${{ steps.get-before-version.outputs.before-version }} to ${{ steps.get-outputs.outputs.version }}" | |
branch: "bump-version-${{ steps.get-outputs.outputs.version }}" | |
base: "main" | |
labels: "version-bump" | |
- name: Force merge PR | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
# Ignore if failed | |
continue-on-error: true | |
# Match head commit to avoid security holes | |
env: | |
GH_TOKEN: ${{ secrets.ORG_BOT_TOKEN }} | |
run: | | |
gh pr merge \ | |
--match-head-commit "${{ steps.cpr.outputs.pull-request-head-sha }}" \ | |
--rebase \ | |
--admin \ | |
"${{ steps.cpr.outputs.pull-request-number }}" | |
- name: Result | |
shell: bash | |
run: "echo 'Version is now ${{ steps.get-outputs.outputs.version }} (Bumped: ${{ steps.get-outputs.outputs.bumped }})'" | |
- name: Print Version | |
run: "echo 'New Version: ${{steps.bump.outputs.version}}'" |