-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
66 lines (60 loc) · 2.16 KB
/
action.yml
File metadata and controls
66 lines (60 loc) · 2.16 KB
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: Prepare Next Version
description: "Updates the revision property in the POM file, creates the changelog entry and opens a pull request."
inputs:
java-version:
description: "The Java version the build shall run with."
required: true
maven-version:
description: "The Maven version the build shall run with."
required: true
new-version:
description: "New version (MAJOR.MINOR.PATCH)"
required: true
changelog-file:
description: "The changelog file to update."
required: true
runs:
using: composite
steps:
- name: Set up Java ${{ inputs.java-version }}
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
java-version: ${{ inputs.java-version }}
distribution: sapmachine
cache: maven
- name: Setup Maven ${{ inputs.maven-version }}
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: ${{ inputs.maven-version }}
- name: Update version
env:
NEW_VERSION: ${{ inputs.new-version }}
run: |
mvn --no-transfer-progress versions:set-property -Dproperty=revision -DnewVersion=NEW_VERSION
shell: bash
- name: Replace Unreleased entry in ${{ inputs.changelog-file }}
env:
NEW_VERSION: ${{ inputs.new-version }}
CHANGELOG_FILE: ${{ inputs.changelog-file }}
run: |
CURRENT_DATE=$(date +%Y-%m-%d)
sed -i -E "0,/^##\s+.*\[Unreleased\].*$/s//## [Unreleased]\\
\\
### Added\\
### Changed\\
### Deprecated\\
### Removed\\
### Fixed\\
### Security\\
\\
## [${NEW_VERSION}] - ${CURRENT_DATE}/" $CHANGELOG_FILE
head -n 20 $CHANGELOG_FILE
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
with:
commit-message: chore/release-${{ inputs.new-version }}
title: "chore(version): version ${{ inputs.new-version }}"
body: Set version to ${{ inputs.new-version }}
branch: chore/release-${{ inputs.new-version }}
reviewers: ${{ github.actor }}