generated from cuioss/cui-java-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 2.88 KB
/
maven-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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Maven Release
on:
pull_request:
types: [ closed ]
paths:
- '.github/project.yml'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
name: release
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the PA_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- uses: radcortez/[email protected]
name: Retrieve project metadata from '.github/project.yml'
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
local-file: true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: sonatype-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: maven
- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "Cuioss Robot Action"
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
git checkout -b release
./mvnw -B --no-transfer-progress -Prelease,javadoc-mm-reporting release:prepare site:site site:stage -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
git checkout ${{vars.GITHUB_BASE_REF}}
git rebase release
./mvnw -B --no-transfer-progress -Prelease,javadoc-mm-reporting release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Deploy Maven Site to cuioss.github.io -> ${{steps.metadata.outputs.pages-reference}}🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/site
repository-name: cuioss/cuioss.github.io
target-folder: ${{steps.metadata.outputs.pages-reference}}
branch: main
token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
- name: Push changes to ${{github.ref_name}}
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{github.ref_name}}
force: true
- name: Push tag ${{steps.metadata.outputs.current-version}}
uses: ad-m/[email protected]
with:
branch: ${{github.ref_name}}
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
force: true