-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.94 KB
/
ci.yaml
File metadata and controls
65 lines (55 loc) · 1.94 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
name: CI/CD Wicket Utils
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Set up | Checkout
uses: actions/checkout@v5
- name: Set up Maven Central Repository
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
server-id: central
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Debug GPG keys
run: |
gpg --version
gpg --list-secret-keys --keyid-format LONG
- name: Set up Maven cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build
run: mvn -B -ntp -Dgpg.skip=true clean install
- name: Release
if: github.event_name == 'release' && github.event.action == 'published'
run: |
# Assign the tag name to a variable
tag_name="${{ github.event.release.tag_name }}"
# Check if the tag name starts with 'v' and strip it if present
if [[ $tag_name == v* ]]; then
tag_name="${tag_name:1}"
fi
git config --global user.email "hallo@denktmit.de"
git config --global user.name "DenktMit eG"
mvn -Drevision=${tag_name} -Dchangelist= -B -ntp -DskipTests -Pci-cd clean deploy
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}