Skip to content

Commit 00a4125

Browse files
authored
ci: added release workflow
For now it's in dry-run mode, it won't commit anything and it won't actually publish anything
1 parent 4792346 commit 00a4125

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
10+
jobs:
11+
release:
12+
13+
runs-on: ubuntu-latest
14+
env:
15+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
17+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
18+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
19+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
20+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
21+
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Set up JDK 11
30+
uses: actions/setup-java@v3
31+
with:
32+
java-version: '11'
33+
distribution: 'temurin'
34+
cache: maven
35+
36+
- name: Stage assemble
37+
run: ./mvnw --no-transfer-progress --batch-mode clean deploy jreleaser:assemble -Prelease
38+
39+
- name: Set release version
40+
run: ./mvnw --no-transfer-progress --batch-mode versions:set -DnewVersion=${{ github.event.inputs.version }}
41+
42+
- name: Commit & Push changes
43+
if: false
44+
uses: actions-js/push@master
45+
with:
46+
github_token: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
47+
message: "ci: Releasing version ${{ github.event.inputs.version }}"
48+
49+
- name: Stage release
50+
run: ./mvnw jreleaser:full-release -Djreleaser.dry.run
51+
52+
- name: Set development version
53+
run: ./mvnw --no-transfer-progress --batch-mode build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
54+
55+
- name: Commit & Push changes
56+
if: false
57+
uses: actions-js/push@master
58+
with:
59+
github_token: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
60+
message: "ci: Prepare for next development iteration"
61+
62+
- name: JReleaser release output
63+
if: always()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: jreleaser-release=output
67+
path: |
68+
target/surefire-reports
69+
target/jreleaser/trace.log
70+
target/jreleaser/output.properties

0 commit comments

Comments
 (0)