-
Notifications
You must be signed in to change notification settings - Fork 155
59 lines (50 loc) · 1.55 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
name: Release to Maven Central
on:
push:
tags:
- '*'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "(.*)"
- name: Set Release version env variable
run: |
echo "TAG_NAME=${{ steps.tagName.outputs.tag }}" >> $GITHUB_ENV
# if no tag exists, this is expected to fail
- name: Switch to git tag for release
run: |
git fetch --all --tags -f
git checkout tags/${{ env.TAG_NAME }} -b ${{ env.TAG_NAME }}-tmp-branch
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
server-id: sonatype-nexus
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
- name: Deploy
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSWORD }}
run: |
./mvnw --batch-mode -Drevision=${{ env.TAG_NAME }} -P release clean deploy
- name: Create GHA release
uses: ncipollo/release-action@v1
with:
draft: true
artifacts: "sonar-pmd-plugin/target/*.jar"
bodyFile: CHANGELOG.md