Skip to content

Commit

Permalink
Prep for alpha release
Browse files Browse the repository at this point in the history
- Update release in POM file
- Add github actions for CI build and documentation
- Fix javadoc warnings

Signed-off-by: Gary O'Neall <[email protected]>
  • Loading branch information
goneall committed Sep 2, 2024
1 parent 684f2bc commit 2225f02
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 11 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
if [[ $SONAR_TOKEN != "" ]]; then
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
else
mvn --batch-mode --update-snapshots verify
fi
32 changes: 32 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Generate and publish API JavaDocs
on:
push:
branches:
- main

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

- name: Generate docs
run: mvn javadoc:javadoc

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site/apidocs
10 changes: 10 additions & 0 deletions RELEASE-CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Release Checklist for the SPDX Java Core Library

- [ ] Check for any warnings from the compiler and findbugs
- [ ] Run unit tests for all packages that depend on the library
- [ ] Run dependency check to find any potential vulnerabilities `mvn dependency-check:check`
- [ ] Run `mvn release:prepare` - you will be prompted for the release - typically take the defaults
- [ ] Run `mvn release:perform`
- [ ] Release artifacts to Maven Central
- [ ] Create a Git release including release notes
- [ ] Zip up the files from the Maven archive and add them to the release
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.spdx</groupId>
<artifactId>spdx-java-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spdx-java-core</name>
<description>Core libraries for SPDX</description>
Expand Down Expand Up @@ -256,7 +256,7 @@
<plugin>
<groupId>org.spdx</groupId>
<artifactId>spdx-maven-plugin</artifactId>
<version>0.6.4</version>
<version>0.7.4</version>
<executions>
<execution>
<id>build-spdx</id>
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/spdx/core/ISpdxModelInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ public interface ISpdxModelInfo {
/**
* @param store store to use for the inflated object
* @param uri URI of the external element
* @param copyManager if non-null, implicitly copy any referenced properties from other model stores
* @param documentUri URI for the SPDX document to store the external element reference - used for compatibility with SPDX 2.X model stores
* @param copyManager if non-null, create the external Doc ref if it is not a property of the SPDX Document
* @param type type hint to create the appropriate external element type
* @param externalMap Map of URI's of elements referenced but not present in the store
* @param specVersion version of the SPDX specification used by the external element
* @return model object of type type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void removeEndParagraphTag() {
/**
* Format HTML for a replaceable string
* @param text text for the optional license string
* @param objectUri ID used for the div
* @param id ID used for the div
* @return a replaceable string
*/
public static String formatReplaceabledHTML(String text, String id) {
Expand Down Expand Up @@ -170,7 +170,7 @@ public void beginOptional(LicenseTemplateRule rule) {

/**
* Format HTML for an optional string
* @param objectUri ID used for the div
* @param id ID used for the div
* @return a formated id for use in the div
*/
public static String formatStartOptionalHTML(String id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void close() throws Exception {

/**
* @param documentUri a nameSpace for the ID
* @param objectUri unique ID within the SPDX document
* @param id unique ID within the SPDX document
* @return true if the objectUri already exists for the documentUri
*/
public boolean exists(String documentUri, String id) {
Expand Down Expand Up @@ -160,7 +160,7 @@ public static TypedValue typedValueFromDocUri(String documentUri, String id, boo
* Convenience method to convert an SPDX 2.X style typed value to the current TypedValue
* @param documentUri SPDX v2 Document URI
* @param id ID consistent with SPDX v2 spec
* @param modelStore store used
* @param store store used
* @param type SPDX type
* @return TypedValue with the proper Object URI formed by the documentUri and ID
* @throws SpdxInvalidIdException if the ID is not valid
Expand Down Expand Up @@ -222,7 +222,7 @@ public boolean exists(String uri) {

/**
* @param documentUri SPDX v2 spec document URI
* @param objectUri SPDX ID
* @param id SPDX ID
* @param type type
* @throws InvalidSPDXAnalysisException on any SPDX exception
*/
Expand Down

0 comments on commit 2225f02

Please sign in to comment.