forked from IBM/JTOpen
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (65 loc) · 2.26 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
name: Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Check out
- name: Get Maven project version
run: |
echo "project_version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec --file pom-dist.xml)" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Install gpg secret key
id: install-secret-key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Install gpg public key
id: install-pulic-key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_PUBLIC_KEY }}") | gpg --batch --import
gpg --list-public-keys --keyid-format LONG
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Build with Maven (Java 8)
run: mvn -B package --file pom.xml
- name: Clean target
run: rm -r target
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Publish package
run: mvn --batch-mode "-Dprod.build=true" -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} clean deploy --file pom-dist.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: List target directory
run: ls -l target
- name: Copy dist artifacts to staging directory
run: mkdir staging && cp target/*.jar staging
- name: create bundle .zip
run: cd staging && zip JTOpen-$project_version.zip *.jar && cd ..
- name: Create the tag and release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.project_version }}
name: v${{ env.project_version }}
files: |
staging/jt400-*.jar
staging/*.zip