forked from deepy/sonar-crowd
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (76 loc) · 2.33 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
permissions:
actions: write
id-token: write
contents: write
jobs:
pre-release:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.vars.outputs.VERSION }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- id: vars
run: |
VERSION=${{ github.event.inputs.version }}
mvn --batch-mode -ntp dependency:go-offline
mvn --batch-mode versions:set -DnewVersion=${VERSION}
mvn --batch-mode versions:commit
git config --global user.name "Hubot"
git config --global user.email "[email protected]"
git commit -a -m "[CI] Release ${VERSION}"
git push origin master
echo "VERSION=$(echo $VERSION)" >> $GITHUB_OUTPUT
release:
needs: [ pre-release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- run: mvn --batch-mode deploy -DaltDeploymentRepository=local::file:./target/staging-deploy
- uses: jreleaser/release-action@v2
with:
arguments: full-release
env:
JRELEASER_PROJECT_VERSION: ${{ needs.pre-release.outputs.VERSION }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
post-release:
needs: [ release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- run: |
mvn --batch-mode versions:set -DnextSnapshot -DnextSnapshotIndexToIncrement=3
mvn --batch-mode versions:commit
git config --global user.name "Hubot"
git config --global user.email "[email protected]"
git commit -a -m "[CI] Prepare for next development iteration"
git push origin master