Skip to content

Commit 4771c56

Browse files
Sean LearySean Leary
authored andcommitted
Merge branch 'master' into gh-pages
2 parents 02654f7 + 3f97826 commit 4771c56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+8333
-1888
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ master ]
9+
schedule:
10+
- cron: '18 18 * * 1'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ 'java' ]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
29+
30+
# Initializes the CodeQL tools for scanning.
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v2
33+
with:
34+
languages: ${{ matrix.language }}
35+
# If you wish to specify custom queries, you can do so here or in a config file.
36+
# By default, queries listed here will override any specified in a config file.
37+
# Prefix the list here with "+" to use these queries and those in the config file.
38+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
39+
40+
- run: "mvn clean compile -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true"
41+
42+
- name: Perform CodeQL Analysis
43+
uses: github/codeql-action/analyze@v2

.github/workflows/deployment.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# For more information see:
2+
# * https://docs.github.com/en/actions/learn-github-actions
3+
# * https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
4+
# * https://github.com/actions/setup-java/blob/v3.13.0/docs/advanced-usage.md#Publishing-using-Apache-Maven
5+
#
6+
7+
name: Deployment workflow
8+
9+
on:
10+
release:
11+
types: [published]
12+
13+
jobs:
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 -source 1.6 -target 1.6 -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: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This workflow will build a Java project with Maven
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
2+
# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
33

44
name: Java CI with Maven
55

@@ -12,63 +12,72 @@ on:
1212
jobs:
1313
# old-school build and jar method. No tests run or compiled.
1414
build-1_6:
15-
runs-on: ubuntu-16.04
16-
strategy:
17-
matrix:
18-
# build for java 1.6, however don't run any tests
19-
java: [ 1.6 ]
20-
name: Java ${{ matrix.java }}
15+
name: Java 1.6
16+
runs-on: ubuntu-latest
2117
steps:
22-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
2319
- name: Setup java
2420
uses: actions/setup-java@v1
2521
with:
26-
java-version: ${{ matrix.java }}
27-
- name: Compile Java ${{ matrix.java }}
22+
java-version: 1.6
23+
- name: Compile Java 1.6
2824
run: |
2925
mkdir -p target/classes
30-
javac -d target/classes/ src/main/java/org/json/*.java
31-
- name: Create java ${{ matrix.java }} JAR
26+
javac -version
27+
javac -source 1.6 -target 1.6 -d target/classes/ src/main/java/org/json/*.java
28+
- name: Create java 1.6 JAR
3229
run: |
3330
jar cvf target/org.json.jar -C target/classes .
34-
- name: Upload Java ${{ matrix.java }} JAR
35-
uses: actions/upload-artifact@v1
31+
- name: Upload JAR 1.6
32+
if: ${{ always() }}
33+
uses: actions/upload-artifact@v3
3634
with:
37-
name: Java ${{ matrix.java }} JAR
38-
path: target/org.json.jar
39-
35+
name: Create java 1.6 JAR
36+
path: target/*.jar
4037
build:
41-
runs-on: ubuntu-16.04
38+
runs-on: ubuntu-latest
4239
strategy:
40+
fail-fast: false
41+
max-parallel: 2
4342
matrix:
4443
# build against supported Java LTS versions:
45-
java: [ 1.7, 8, 11 ]
44+
java: [ 8, 11, 17, 21 ]
4645
name: Java ${{ matrix.java }}
4746
steps:
48-
- uses: actions/checkout@v2
49-
- name: Setup java
50-
uses: actions/setup-java@v1
47+
- uses: actions/checkout@v3
48+
- name: Set up JDK ${{ matrix.java }}
49+
uses: actions/setup-java@v3
5150
with:
51+
distribution: 'temurin'
5252
java-version: ${{ matrix.java }}
53+
cache: 'maven'
5354
- name: Compile Java ${{ matrix.java }}
54-
run: mvn clean compile -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
55+
run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true
5556
- name: Run Tests ${{ matrix.java }}
5657
run: |
57-
mvn test -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
58+
mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
5859
- name: Build Test Report ${{ matrix.java }}
5960
if: ${{ always() }}
6061
run: |
61-
mvn surefire-report:report-only -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
62-
mvn site -DgenerateReports=false -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
62+
mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
63+
mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }}
6364
- name: Upload Test Results ${{ matrix.java }}
6465
if: ${{ always() }}
65-
uses: actions/upload-artifact@v1
66+
uses: actions/upload-artifact@v3
6667
with:
6768
name: Test Results ${{ matrix.java }}
6869
path: target/surefire-reports/
6970
- name: Upload Test Report ${{ matrix.java }}
7071
if: ${{ always() }}
71-
uses: actions/upload-artifact@v1
72+
uses: actions/upload-artifact@v3
7273
with:
7374
name: Test Report ${{ matrix.java }}
74-
path: target/site/
75+
path: target/site/
76+
- name: Package Jar ${{ matrix.java }}
77+
run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true
78+
- name: Upload Package Results ${{ matrix.java }}
79+
if: ${{ always() }}
80+
uses: actions/upload-artifact@v3
81+
with:
82+
name: Package Jar ${{ matrix.java }}
83+
path: target/*.jar

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ignore eclipse project files
22
.project
33
.classpath
4+
# ignore vscode files
5+
.vscode
46
# ignore Intellij Idea project files
57
.idea
68
*.iml

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at jsonjava060@gmail.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contribution Guidelines
2+
3+
Feel free to work on any open issue, you don't need to ask permission first. This year, the hacktoberfest label will be added to any PR and associated issue during the month of October.
4+
5+
If you discover an issue you would like to work on, you can add a new issue to the list. If it meets our criteria, it will be available to work on (if not, it will be closed after review).
6+
7+
# Who is allowed to submit pull requests for this project?
8+
9+
Anyone can submit pull requests for code, tests, or documentation.
10+
11+
# How do you decide which pull requests to accept?
12+
13+
* Does it call out a bug that needs to be fixed? If so, it goes to the top of the list.
14+
* Does it fix a major user inconvenience? These are given high priority as well.
15+
* Does it align with the specs? If not, it will probably not be accepted. It turns out there are gray areas in the specs. If this is in a gray area, it will likely be given the benefit of the doubt.
16+
* Does it break the existing behavior of the lib? If so, it will not be accepted, unless it fixes an egregious bug. This is happening less frequently now.
17+
18+
# For more guidance, see these links:
19+
20+
[README.md (includes build instructions)](https://github.com/stleary/JSON-java#readme)
21+
22+
[FAQ - all your questions answered](https://github.com/stleary/JSON-java/wiki/FAQ)

0 commit comments

Comments
 (0)