Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alex/v1 update pipeline and veracode #75

Merged
merged 7 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 19 additions & 74 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ on:
workflow_dispatch:

env:
VERSION_PREFIX: 1.0.0
VERSION_PREFIX: 1.1.1

jobs:
build-n-test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
Expand All @@ -35,7 +35,7 @@ jobs:
run: mvn test

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "target/surefire-reports/*.xml"
Expand All @@ -46,10 +46,10 @@ jobs:
needs: [ build-n-test ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
Expand All @@ -64,7 +64,7 @@ jobs:
run: mv ${{ github.workspace }}/target/site/ ${{ github.workspace }}/docs_temp/${{ github.ref_name }}

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v4
with:
name: documentation-artifact
# A file, directory or wildcard pattern that describes what to upload
Expand All @@ -83,7 +83,7 @@ jobs:
run: mkdir -p ./docs_temp/${{ github.ref_name }}/html/

- name: Download a Build Artifact
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v4
with:
name: documentation-artifact
path: ${{ github.workspace }}/docs_temp/${{ github.ref_name }}/html/
Expand All @@ -100,55 +100,6 @@ jobs:

- name: Delete temporary directory
run: rm -r ./docs_temp/${{ github.ref_name }}/html/

publish-preview-package:
runs-on: ubuntu-latest
environment: preview
if: ${{ github.run_attempt != 1 }}
needs: [ build-n-test, build-documentation ] # wait for build to finish

steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'

- name: Build with Maven
run: mvn -B package -Dmaven.test.skip=true --file pom.xml

- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set Java Package Version environment
run: echo "PACKAGE_VERSION=${{ env.VERSION_PREFIX }}-preview-${{ github.run_id }}-SNAPSHOT" >> $GITHUB_ENV

- name: Set Java Package Version
run: mvn versions:set -DnewVersion=${{ env.PACKAGE_VERSION }}

- name: Publish to Sonatype
run: mvn clean deploy -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

- name: Tag commit
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.PACKAGE_VERSION }}
commit_sha: ${{ github.sha }}
message: Workflow run ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

publish-production-package:
runs-on: ubuntu-latest
Expand All @@ -157,40 +108,34 @@ jobs:
needs: [ build-n-test, build-documentation ] # wait for build to finish

steps:
- uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'

- name: Build with Maven
run: mvn -B package -Dmaven.test.skip=true --file pom.xml
- uses: actions/checkout@v4

- name: Set up Apache Maven Central
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
server-id: ossrh
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Import GPG Key
run: |
echo "${{ secrets.MAVEN_GPG_SECRET_KEY }}" | gpg --batch --import

- name: Set Java Package Version environment
run: echo "PACKAGE_VERSION=${{ env.VERSION_PREFIX }}" >> $GITHUB_ENV

- name: Set Java Package Version
run: mvn versions:set -DnewVersion=${{ env.PACKAGE_VERSION }}

- name: Publish to Maven Central
run: mvn clean deploy -P release -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: mvn clean deploy -Pdeploy-to-maven -Dmaven.test.skip=true -Dgpg.passphrase=${{ secrets.MAVEN_GPG_SECRET_KEY_PASSPHRASE }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERTOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_USERTOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_SECRET_KEY_PASSPHRASE }}

- name: Tag commit
uses: rickstaa/action-create-tag@v1
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.1.1

### Chore & Maintenance

- Update dependency version for `nimbus-jose-jwt` due to vulnerability

## 1.1.0

### Features
Expand All @@ -14,4 +20,4 @@

### Features

- Add self-hosted API Server support.
- Add self-hosted API Server support.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Laserfiche API Client Core

**[Deprecated]: Please use the [latest version](https://github.com/Laserfiche/lf-api-client-core-java)**

Implementation of various foundational APIs for Laserfiche, including authorization APIs such as OAuth 2.0 flows for secure and easy access to Laserfiche APIs.

## Documentation

- [Java Doc for Laserfiche API Client Core library](https://s01.oss.sonatype.org/service/local/repositories/releases/archive/com/laserfiche/lf-api-client-core/1.0.0/lf-api-client-core-1.0.0-javadoc.jar/!/index.html)
- [Laserfiche API Client Core library](https://central.sonatype.com/artifact/com.laserfiche/lf-api-client-core)

## Installation

Expand All @@ -14,6 +16,6 @@ Add the following to your pom.xml file:
<dependency>
<groupId>com.laserfiche</groupId>
<artifactId>lf-api-client-core</artifactId>
<version>1.0.0</version>
<version>1.0</version>
</dependency>
```
46 changes: 25 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.laserfiche</groupId>
<artifactId>lf-api-client-core</artifactId>
Expand Down Expand Up @@ -33,29 +33,14 @@
</developer>
</developers>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -164,7 +149,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -197,11 +182,30 @@
</plugins>
</build>

<profiles>
<profile>
<id>deploy-to-maven</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.22</version>
<version>9.41.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down