-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (60 loc) · 2.25 KB
/
deploy.yml
File metadata and controls
71 lines (60 loc) · 2.25 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
name: Deploy Release of koson
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
env:
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_TTY: $(tty)
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
steps:
- name: Checkout Scm
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Configure GPG Key
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import -v --batch
- name: Configure GPG Ownertrust
run: |
echo -n "$GPG_OWNERTRUST" | base64 --decode | gpg --import-ownertrust
- name: Configure Maven Settings
run : cp .github/workflows/settings.xml $HOME/.m2/settings.xml
- name: Compute version
id: compute_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Change project version
run: |
mvn -B versions:set versions:commit -DnewVersion=${{ steps.compute_version.outputs.new_version }}
git config --global user.name "Lectra CI User"
git config --global user.email "lectra.ci.user@lectra.com"
git commit -a -m "chore: update project version to ${{ steps.compute_version.outputs.new_version }}"
- name: Build with Maven
run: |
gpg --list-keys
gpg --list-secret-keys
mvn -B clean deploy -Prelease
- name: Tag project
run: |
git tag -m "release ${{ steps.compute_version.outputs.new_tag }}" ${{ steps.compute_version.outputs.new_tag }}
git push origin ${{ steps.compute_version.outputs.new_tag }}
git push origin HEAD:main
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.compute_version.outputs.new_tag }}
name: ${{ steps.compute_version.outputs.new_tag }}
body: ${{ steps.compute_version.outputs.changelog }}