-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
239 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Development | ||
on: | ||
push: | ||
tags-ignore: | ||
- "**" | ||
branches: | ||
- "main" | ||
|
||
env: | ||
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" | ||
|
||
jobs: | ||
continuous-integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.6 | ||
- name: Test | ||
run: mvn $MAVEN_CLI_OPTS test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build library | ||
run: mvn $MAVEN_CLI_OPTS clean package -DskipTests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build CLI | ||
run: mvn $MAVEN_CLI_OPTS clean package -Pcli -DskipTests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload job artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact | ||
path: target/*.jar | ||
if-no-files-found: error | ||
retention-days: 5 | ||
deploy-docker: | ||
runs-on: ubuntu-latest | ||
needs: continuous-integration | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.6 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: docker/target | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
#- name: Login to DockerHub container registry | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: docker | ||
push: true | ||
tags: | | ||
ghcr.io/keeps/commons-ip-cits-erms:latest | ||
# keeps/commons-ip-cits-erms | ||
sbom: true | ||
provenance: mode=max | ||
- name: Deploy to GitHub packages | ||
run: mvn $MAVEN_CLI_OPTS clean deploy -Dmaven.test.skip=true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
name: Development | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
branches-ignore: | ||
- "**" | ||
|
||
env: | ||
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version" | ||
|
||
jobs: | ||
continuous-integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.6 | ||
- name: Test | ||
run: mvn $MAVEN_CLI_OPTS test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build library | ||
run: mvn $MAVEN_CLI_OPTS clean package -DskipTests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build CLI | ||
run: mvn $MAVEN_CLI_OPTS clean package -Pcli -DskipTests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload job artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact | ||
path: target/*.jar | ||
if-no-files-found: error | ||
retention-days: 5 | ||
deploy-docker: | ||
runs-on: ubuntu-latest | ||
needs: continuous-integration | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.9.6 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: docker/target | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
#- name: Login to DockerHub container registry | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/keeps/commons-ip-cits-erms | ||
# keeps/roda | ||
tags: | | ||
type=semver,pattern=v{{version}} | ||
type=semver,pattern=v{{major}}.{{minor}} | ||
type=semver,pattern=v{{major}} | ||
flavor: | | ||
latest=false | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: docker | ||
push: true | ||
tags: | | ||
ghcr.io/keeps/commons-ip-cits-erms | ||
# keeps/commons-ip-cits-erms | ||
sbom: true | ||
provenance: mode=max | ||
- name: Deploy to GitHub packages | ||
run: mvn $MAVEN_CLI_OPTS clean deploy -Dmaven.test.skip=true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get release version | ||
run: echo "release_version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | ||
- name: Upload artifact to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: docker/target/${{ env.release_version }}.jar | ||
asset_name: commons-ip-cits-erms-cli-${{ env.release_version }}.war | ||
tag: ${{ github.ref }} | ||
release_name: ${{ github.ref_name }} | ||
draft: true | ||
body: | | ||
#### New features | ||
#### Enhancements | ||
#### Bug fixes | ||
#### Security | ||
- Several dependency major upgrades to fix security vulnerabilities |