-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (79 loc) · 2.75 KB
/
Copy pathci.yml
File metadata and controls
82 lines (79 loc) · 2.75 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on: push
env:
mainBranchName: main
semanticReleaseVersion: 19.0.5
semanticChangelogVersion: 6.0.1
semanticGitVersion: 10.0.1
semanticExecVersion: 6.0.3
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get branch name
run: |
echo "GITHUB_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Display branch name
run: |
echo "Branche : ${{ env.GITHUB_BRANCH }}"
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up JDK 21
uses: actions/setup-java@v5.6.0
with:
java-version: 21
distribution: temurin
- name: Cache local Maven repository
uses: actions/cache@v6.1.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Import GPG and Prepare build
run: export GPG_TTY=$(tty) && echo -e "$GPG_PRIVATE_KEY" | gpg --batch --import && chmod +x mvnw
env:
GPG_PRIVATE_KEY: ${{ secrets.gpg_private_key }}
- name: Prepare Maven Settings
uses: s4u/maven-settings-action@v4.0.0
with:
githubServer: false
properties: |
[
{"gpg.passphrase": "${{ secrets.GPG_PASSPHRASE }}"}
]
servers: |
[{
"id": "central",
"username": "${{ secrets.NEXUS_USERNAME }}",
"password": "${{ secrets.NEXUS_PASSWORD }}"
}]
- name: Verify Maven
run: ./mvnw -B -ntp verify 1>&2
- name: Semantic Prerelease
if: env.GITHUB_BRANCH != env.mainBranchName
uses: cycjimmy/semantic-release-action@v6.0.0
with:
semantic_version: ${{ env.semanticReleaseVersion }}
branches: ${{ env.GITHUB_BRANCH }}
extra_plugins: |
@semantic-release/changelog@${{ env.semanticChangelogVersion }}
@semantic-release/git@${{ env.semanticGitVersion }}
@semantic-release/exec@${{ env.semanticExecVersion }}
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.CR_TOKEN }}
- name: Semantic Release
if: env.GITHUB_BRANCH == env.mainBranchName
uses: cycjimmy/semantic-release-action@v6.0.0
with:
semantic_version: ${{ env.semanticReleaseVersion }}
branches: ${{ env.mainBranchName }}
extra_plugins: |
@semantic-release/changelog@${{ env.semanticChangelogVersion }}
@semantic-release/git@${{ env.semanticGitVersion }}
@semantic-release/exec@${{ env.semanticExecVersion }}
env:
GITHUB_TOKEN: ${{ secrets.CR_TOKEN }}