-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (52 loc) · 1.85 KB
/
release.yml
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to release'
required: true
jobs:
releaseVersion:
runs-on: ubuntu-22.04
env:
MAVEN_ARGS: "-B -ntp"
VERSION: ${{ github.event.inputs.version }}
steps:
- run: |
echo "Version: ${{ env.VERSION }}"
- name: Setup checkout
uses: actions/checkout@v4
with:
# Use a PAT to ensure that
# commits are authored with a specific user
# workflow run are triggered after git push
token: ${{ secrets.GH_RELEASE_TOKEN }}
- name: Config git
run: |
git config --local user.email "${{ vars.PA_BOT_EMAIL }}"
git config --local user.name "${{ vars.PA_BOT_NAME }}"
git config pull.rebase true
- name: Checkout default branch
run: git checkout master && git pull --tags
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
cache: 'maven'
- name: Set release version of the java project
run: |
cd ${{ github.workspace }}/java && ./mvnw ${{env.MAVEN_ARGS}} versions:set -DnewVersion=${{ env.VERSION }} versions:commit
cd ${{ github.workspace }}
git commit -a -m "chore(release): ${{ env.VERSION }}"
- name: Create the release tag
run: |
git tag -a v${{ env.VERSION }} -m "chore(release): ${{ env.VERSION }}"
- name: Set development version of the java project
run: |
cd ${{ github.workspace }}/java && ./mvnw ${{env.MAVEN_ARGS}} versions:set -DnextSnapshot=true versions:commit
cd ${{ github.workspace }}
git commit -a -m "chore(release): prepare next development version"
- name: Push commits and tags
run: |
git push
git push --tags