-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (69 loc) · 2.48 KB
/
release.yml
File metadata and controls
79 lines (69 loc) · 2.48 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
67
68
69
70
71
72
73
74
75
76
77
78
79
---
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
env:
JAVA_VERSION: '11'
JAVA_DISTRO: 'zulu'
USER_EMAIL: 'cdevents@cd.foundation'
USER_NAME: 'CDEvents Bot'
USER_ID: 'cdevents-bot'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
token: ${{ secrets.GH_BOT_TOKEN }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: maven
- name: Set Version
run: |
VERSION=${{ github.event.inputs.version }}
echo "Updating POMs to version $VERSION"
./mvnw -ntp -B versions:set versions:commit -DnewVersion=$VERSION
git config --global user.email "${{ env.USER_EMAIL }}"
git config --global user.name "${{ env.USER_NAME }}"
git commit -a -s -m "Releasing version $VERSION"
git push
- name: Stage deploy
run: |
./mvnw -ntp -B --file pom.xml -Ppublication
- name: Release
run: |
./mvnw -ntp -B --file pom.xml -Prelease -pl :cdevents-sdk-java-parent
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
JRELEASER_NEXUS2_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties
- name: Bump to snapshot
run: |
./mvnw -ntp -B versions:set versions:commit -DnextSnapshot=true
sed -i -e "s@project.build.outputTimestamp>.*</project.build.outputTimestamp@project.build.outputTimestamp>\${git.commit.author.time}</project.build.outputTimestamp@g" pom.xml
git config --global user.email "${{ env.USER_EMAIL }}"
git config --global user.name "${{ env.USER_NAME }}"
git commit -a -s -m "Bump version to next snapshot"
git push