-
-
Notifications
You must be signed in to change notification settings - Fork 75
103 lines (92 loc) · 3.98 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: create release
run-name: "Release ${{ inputs.releaseversion }}"
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version (yyyy.mm.<no>)'
required: true
type: string
default: "X.Y.Z"
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
attestations: write
id-token: write
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set git config
env:
GH_TOKEN: ${{ github.token }}
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
cache: 'maven'
- name: Setup settings.xml
uses: s4u/[email protected]
with:
override: true
servers: |
[{
"id": "repo.jenkins-ci.org",
"username": "${{ secrets.OSS_JENKINS_USER }}",
"password": "${{ secrets.OSS_JENKINS_PASS }}"
}]
- name: Create release
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TZ="Europe/Berlin"
git checkout -b release/${{ inputs.releaseversion }}
mvn release:prepare release:perform -B -DreleaseVersion=${{ inputs.releaseversion }} -DpushChanges=false -DskipTests=true -DskipITs=true -DlocalCheckout=true -D"arguments=-Dmaven.deploy.skip=true -DskipTests=true -DskipITs=true"
# manually push
git push --tags
git push origin release/${{ inputs.releaseversion }}
git branch --set-upstream-to=origin/release/${{ inputs.releaseversion }} release/release/${{ inputs.releaseversion }}
# write version info
cat <<EOF >target/config.json
{
"version": "${{ inputs.releaseversion }}"
}
EOF
- name: Conventional Changelog Action
id: create-changelog
uses: TriPSs/conventional-changelog-action@v5
with:
input-file: CHANGELOG.md
github-token: ${{ secrets.GITHUB_TOKEN }}
version-file: target/config.json
pre-release: true
skip-bump: true
skip-tag: true
skip-on-empty: true
tag-prefix: 'v'
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update report
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
branch: release/${{ inputs.releaseversion }}
base: develop
delete-branch: true
title: '[Release] ${{ inputs.releaseversion }}'
body: |
Release Plugin v${{ inputs.releaseversion }}
labels: |
release
assignees: hypery2k
draft: false