-
Notifications
You must be signed in to change notification settings - Fork 103
61 lines (59 loc) · 2.17 KB
/
release.yml
File metadata and controls
61 lines (59 loc) · 2.17 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
name: Publish
on:
workflow_call:
inputs:
tag_name:
description: 'Release tag name (e.g. v4.1.1)'
required: true
type: string
workflow_dispatch:
inputs:
tag_name:
description: 'Release tag name (e.g. v4.1.1)'
required: true
type: string
jobs:
publish:
runs-on: ubuntu-24.04-arm
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
- name: Publish to Maven Central
run: ./gradlew -Dorg.gradle.configuration-cache=false publish jreleaserDeploy
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v7
with:
name: jreleaser-publish
path: |
build/jreleaser/trace.log
build/jreleaser/output.properties
- name: Bump to next SNAPSHOT version
run: |
RELEASED_VERSION="${{ inputs.tag_name }}"
RELEASED_VERSION="${RELEASED_VERSION#v}"
IFS='.' read -r MAJOR MINOR PATCH <<< "${RELEASED_VERSION}"
NEXT_VERSION="${MAJOR}.$((MINOR + 1)).0-SNAPSHOT"
sed -i "s/version = \"${RELEASED_VERSION}\".*/version = \"${NEXT_VERSION}\" \/\/ x-release-please-version/" build.gradle.kts
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add build.gradle.kts
git commit -m "chore: bump version to ${NEXT_VERSION}"
git push