-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (99 loc) · 2.95 KB
/
java.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
101
102
103
name: Java
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
name: Java ${{ matrix.java }}
strategy:
matrix:
java:
- '17' # EOL: 2026-09
- '21' # EOL: 2028-09
#- '22' # REL: 2024-03
#- '23' # REL: 2024-09
#- '24' # REL: 2025-03
#- '25' # REL: 2025-09
# see supported java release schedule at https://www.oracle.com/java/technologies/java-se-support-roadmap.html
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.java
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
check-latest: true
- name: Build with Maven
run: mvn -B package --file pom.xml
working-directory: getargv.java
- name: Test with Maven
run: mvn -B test --file pom.xml
working-directory: getargv.java
release:
permissions:
contents: write
packages: write
needs: [ build ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.java
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
check-latest: true
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
- name: Publish package to Maven Central
run: make release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
working-directory: getargv.java
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
check-latest: true
server-id: github
- name: fix artifactid & groupid in pom
run: sed -e 's/artifactId>Getargv</artifactId>getargv</g' -e 's/groupId>cam.narzt.getargv</groupId>github.getargv</g' -i '' pom.xml
working-directory: getargv.java
- name: Publish package to GitHub Packages
run: mvn -DuseGithub=true --batch-mode deploy
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_ACTOR: getargv
working-directory: getargv.java