-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (60 loc) · 2.69 KB
/
create-tag.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
59
60
61
62
63
64
65
66
67
68
69
70
name: Prepare version for next release and create tag
on:
push:
branches:
- 'release'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.LOGCHANGE_PAT_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v4
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
with:
distribution: 'temurin'
java-version: 21
token: ${{ secrets.LOGCHANGE_PAT_TOKEN }}
- name: Release and Generate CHANGELOG
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
run: mvn dev.logchange:logchange-maven-plugin:release --non-recursive
- name: Set up Git
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
run: git config --global user.name hofund-bot && git config --global user.email [email protected]
- name: Commit generated CHANGELOG
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
run: git status && git add ./changelog/ && git commit -am "[ci skip] Generated CHANGELOG.md and prepare version for next release" || echo "Nothing to commit"
- name: Push generated CHANGELOG
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
run: git push
- name: Git status
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
run: git status
# Worth reading regarding GITHUB TOKEN
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
- name: Java Maven release
uses: qcastel/[email protected]
if: "!contains(github.event.head_commit.message, 'Releasing new version')"
with:
# Cannot use GITHUB_TOKEN because of:
# https://github.com/orgs/community/discussions/27028
access-token: ${{ secrets.LOGCHANGE_PAT_TOKEN }}
release-branch-name: "release"
version-minor: true
skip-perform: true
git-skip-sanity-check: true
env:
JAVA_HOME: /usr/lib/jvm/java-21-openjdk/
- name: pull-request
uses: repo-sync/pull-request@v2
if: "contains(github.event.head_commit.message, 'prepare for next development iteration')"
with:
destination_branch: "master"
github_token: ${{ secrets.LOGCHANGE_PAT_TOKEN }}
pr_title: "release to main - preparation for next development cycle"
pr_body: "Autogenerated PR"
pr_allow_empty: true
pr_assignee: "marwin1991"