-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (56 loc) · 2.16 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (56 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: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
env:
RELEASE_USERNAME: ${{ github.actor }}
RELEASE_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK 8
uses: actions/setup-java@v5.2.0
with:
java-version: '8'
distribution: zulu
cache: maven
server-id: github-packages
server-username: RELEASE_USERNAME
server-password: RELEASE_TOKEN
- name: Set release version
run: |
mvn versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
sed -i "s/<revision>.*<\/revision>/<revision>${{ github.event.inputs.version }}<\/revision>/" pom.xml
echo "Set version to ${{ github.event.inputs.version }}"
- name: Build and publish
run: mvn -B -P github-packages -DskipTests -Dfindbugs.skip=true -Dpmd.skip=true -Dcpd.skip=true clean deploy
- name: Create release
uses: softprops/action-gh-release@v3.0.0
with:
tag_name: v${{ github.event.inputs.version }}
name: v${{ github.event.inputs.version }}
generate_release_notes: true
files: omod/target/*.omod
- name: Bump to next SNAPSHOT
run: |
IFS='.' read -r major minor patch <<< "${{ github.event.inputs.version }}"
next_patch=$((patch + 1))
next_version="${major}.${minor}.${next_patch}-SNAPSHOT"
mvn versions:set -DnewVersion=${next_version} -DgenerateBackupPoms=false
sed -i "s/<revision>.*<\/revision>/<revision>${next_version}<\/revision>/" pom.xml
echo "Bumped to ${next_version}"
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Bump version to next SNAPSHOT after v${{ github.event.inputs.version }} release"
git push