-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (62 loc) · 2.13 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (62 loc) · 2.13 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Release version without the leading v
required: true
type: string
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
environment: jreleaser
steps:
- name: Check out source
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v6
with:
java-version: '21'
distribution: temurin
cache: maven
- name: Set release version
env:
TAG_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
INPUT_VERSION: ${{ inputs.version }}
run: |
VERSION="${INPUT_VERSION:-${TAG_VERSION#v}}"
if [[ -z "$VERSION" || "$VERSION" == "$TAG_VERSION" && "$TAG_VERSION" != v* ]]; then
echo "A release tag or workflow version is required"
exit 1
fi
echo "JRELEASER_PROJECT_VERSION=$VERSION" >> "$GITHUB_ENV"
./mvnw -B versions:set -DnewVersion="$VERSION" -DgenerateBackupPoms=false
- name: Stage Maven Central artifacts
run: >-
./mvnw -B -Prelease deploy
-DaltDeploymentRepository=staging::default::file:${{ github.workspace }}/target/staging-deploy
- name: Release with JReleaser
uses: jreleaser/release-action@v2
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v7
with:
name: jreleaser-release-output
path: |
target/surefire-reports
target/jreleaser/trace.log
target/jreleaser/output.properties