-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 1.71 KB
/
release.yml
File metadata and controls
59 lines (57 loc) · 1.71 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
name: Frontegg Java SDK - release
on:
push:
branches:
- "main"
permissions:
actions: read
checks: write
contents: write
env:
LANG: en_US.UTF-8
jobs:
release:
name: Release the new version
runs-on: ubuntu-latest
if: |
github.repository == 'frontegg/java-sdk' &&
startsWith(github.event.head_commit.message, '[maven-release-plugin] prepare release')
steps:
- id: create_bot_token
name: Create bot token
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.GH_FRONTEGG_BOT_APP_ID }}
private_key: ${{ secrets.GH_FRONTEGG_BOT_APP_SECRET }}
- name: Checkout repo
uses: actions/checkout@v4
with:
token: ${{ steps.create_bot_token.outputs.BOT_TOKEN }}
ref: ${{ github.sha }}
fetch-depth: 0
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
server-id: ossrh
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build
run: mvn -e -B clean install
- name: Release
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mvn -e -B -Prelease deploy