Skip to content

Commit a2a8240

Browse files
author
John J. Aylward
committed
upload jar files to GitHub release
1 parent 1ab11d0 commit a2a8240

File tree

2 files changed

+72
-36
lines changed

2 files changed

+72
-36
lines changed

.github/workflows/deployment.yml

Lines changed: 69 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,72 @@ on:
1111
types: [published]
1212

1313
jobs:
14-
publish:
15-
runs-on: ubuntu-latest
16-
permissions:
17-
contents: read
18-
packages: write
19-
steps:
20-
- uses: actions/checkout@v4
21-
- name: Set up Java for publishing to Maven Central Repository
22-
uses: actions/setup-java@v3
23-
with:
24-
# Use lowest supported LTS Java version
25-
java-version: '8'
26-
distribution: 'temurin'
27-
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
28-
server-username: MAVEN_USERNAME # env variable for username in deploy
29-
server-password: MAVEN_PASSWORD # env variable for token in deploy
30-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
31-
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
32-
33-
- name: Publish to the Maven Central Repository
34-
run: mvn --batch-mode deploy
35-
env:
36-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
37-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
38-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
39-
# - name: Set up Java for publishing to GitHub Packages
40-
# uses: actions/setup-java@v3
41-
# with:
42-
# # Use lowest supported LTS Java version
43-
# java-version: '8'
44-
# distribution: 'temurin'
45-
# - name: Publish to GitHub Packages
46-
# run: mvn --batch-mode deploy
47-
# env:
48-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
# old-school build and jar method. No tests run or compiled.
15+
publish-1_6:
16+
name: Publish Java 1.6 to GitHub Release
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup java
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 1.6
26+
- name: Compile Java 1.6
27+
run: |
28+
mkdir -p target/classes
29+
javac -version
30+
javac -d target/classes/ src/main/java/org/json/*.java
31+
- name: Create JAR 1.6
32+
run: |
33+
jar cvf "target/org.json-1.6-${{ github.ref_name }}.jar" -C target/classes .
34+
- name: Add 1.6 Jar To Release
35+
uses: softprops/action-gh-release@v1
36+
with:
37+
append_body: true
38+
files: |
39+
target/*.jar
40+
publish:
41+
name: Publish Java 8 to Maven Central and GitHub Release
42+
runs-on: ubuntu-latest
43+
permissions:
44+
contents: write
45+
packages: write
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Set up Java for publishing to Maven Central Repository
49+
uses: actions/setup-java@v3
50+
with:
51+
# Use lowest supported LTS Java version
52+
java-version: '8'
53+
distribution: 'temurin'
54+
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
55+
server-username: MAVEN_USERNAME # env variable for username in deploy
56+
server-password: MAVEN_PASSWORD # env variable for token in deploy
57+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
58+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
59+
60+
- name: Publish to the Maven Central Repository
61+
run: mvn --batch-mode deploy
62+
env:
63+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
64+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
65+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
66+
67+
- name: Add Jar To Release
68+
uses: softprops/action-gh-release@v1
69+
with:
70+
append_body: true
71+
files: |
72+
target/*.jar
73+
# - name: Set up Java for publishing to GitHub Packages
74+
# uses: actions/setup-java@v3
75+
# with:
76+
# # Use lowest supported LTS Java version
77+
# java-version: '8'
78+
# distribution: 'temurin'
79+
# - name: Publish to GitHub Packages
80+
# run: mvn --batch-mode deploy
81+
# env:
82+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pipeline.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
java: [ 1.6 ]
2020
name: Java ${{ matrix.java }}
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- name: Setup java
2424
uses: actions/setup-java@v1
2525
with:
@@ -41,6 +41,8 @@ jobs:
4141
build:
4242
runs-on: ubuntu-latest
4343
strategy:
44+
fail-fast: false
45+
max-parallel: 2
4446
matrix:
4547
# build against supported Java LTS versions:
4648
java: [ 8, 11, 17, 21 ]

0 commit comments

Comments
 (0)