-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 3.44 KB
/
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: JPALite Release
on:
workflow_dispatch:
pull_request:
types: [ closed ]
paths:
- '.github/project.yml'
- '.github/workflows/client.ovpn'
- '.github/workflows/release.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-latest
name: release
if: ${{github.event.pull_request.merged == true}}
steps:
- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
- uses: actions/checkout@v4
- name: Install OpenVPN
run: |
sudo mkdir -p /etc/apt/keyrings
sudo chmod 755 /etc/apt/sources.list.d
sudo curl -sSfL https://packages.openvpn.net/packages-repo.gpg > /tmp/openvpn.asc
sudo cp /tmp/openvpn.asc /etc/apt/keyrings/
sudo echo "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian noble main" >> /tmp/openvpn3.list
sudo cp /tmp/openvpn3.list /etc/apt/sources.list.d/
sudo apt-get update -y
sudo apt-get install -y openvpn3
- name: Connect to VPN
uses: "eddiecarpenter/github-openvpn-connect-action@v3"
with:
echo_config: true
use_openvpn3: true
config_file: .github/workflows/client.ovpn
username: ${{ secrets.OVPN_USERNAME }}
password: ${{ secrets.OVPN_PASSWORD }}
client_key: ${{ secrets.OVPN_CLIENT_KEY }}
tls_crypt_v2_key: ${{ secrets.OVPN_TLS_AUTH_KEY }}
- name: Set up JDK 21
uses: actions/[email protected]
with:
distribution: temurin
java-version: 21
cache: 'maven'
server-id: common
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set up Maven 3.9.6
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Update latest release version in docs
run: |
mvn -B -ntp -pl docs -am package -DskipTests -DskipITs -Denforcer.skip -Dformatter.skip -Dimpsort.skip
if ! git diff --quiet docs/modules/ROOT/pages/includes; then
git add docs/modules/ROOT/pages/includes
git commit -m "Update the latest release version ${{steps.metadata.outputs.current-version}} in documentation"
fi
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Push changes to ${{github.base_ref}} branch
run: |
git push
git push origin ${{steps.metadata.outputs.current-version}}