-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.58 KB
/
Copy pathpublish.yml
File metadata and controls
54 lines (45 loc) · 1.58 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g. 1.2.0)'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Configure git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Set release version
run: mvn -B versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
- name: Commit and tag
run: |
git commit -am "Release ${{ github.event.inputs.version }}"
git tag v${{ github.event.inputs.version }}
- name: Deploy to Central
run: mvn -B clean deploy -Prelease
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Bump to next snapshot
run: |
mvn -B versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
git commit -am "Prepare next development iteration"
- name: Push commits and tag
run: git push origin main --tags