-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 2.04 KB
/
bump_version.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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@v6
id: cpr
with:
token: ${{ secrets.github_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: Enable Pull Request Automerge
if: ${{ steps.cpr.outputs.pull-request-number }}
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.github_token }}
- 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}}'"