-
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 3.36 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
env:
JAVA_VERSION: '11'
JAVA_DISTRO: 'zulu'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Maven
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
- name: Update version
run: |
VERSION=${{ github.event.inputs.version }}
echo "Updating POMs to version $VERSION"
./mvnw -B versions:set -DnewVersion=$VERSION -f pom.xml
./mvnw -B versions:set -DnewVersion=$VERSION -f oci-maven-plugin/pom.xml
./mvnw -B versions:set -DnewVersion=$VERSION -f oci-maven-plugin-guide/pom.xml
./mvnw -B versions:commit
echo $VERSION > VERSION
sed -i -e "s/^\:project-version\:\ .*/:project-version: ${VERSION}/g" README.adoc
git config --global user.email "[email protected]"
git config --global user.name "kordamp-release-bot"
git commit -a -m "Releasing version $VERSION"
git push origin master
- name: Stage deploy
run: |
./mvnw -ntp -B --file oci-maven-plugin/pom.xml -Ppublication deploy -DaltDeploymentRepository=local::file:oci-maven-plugin/target/staging-deploy
- name: Release
uses: jreleaser/release-action@v2
env:
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_SDKMAN_CONSUMER_KEY: ${{ secrets.SDKMAN_CONSUMER_KEY }}
JRELEASER_SDKMAN_CONSUMER_TOKEN: ${{ secrets.SDKMAN_CONSUMER_TOKEN }}
JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
JRELEASER_MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v3
with:
name: artifact
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
- name: Build guide
run: |
export GPG_TTY=$(tty)
./mvnw -ntp -B --file oci-maven-plugin-guide/pom.xml generate-resources
- name: Publish guide
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: oci-maven-plugin-guide/target/generated-docs