Skip to content

Merge pull request #43 from Norconex/snyk-upgrade-e965eb8a7e7fca80e1b… #159

Merge pull request #43 from Norconex/snyk-upgrade-e965eb8a7e7fca80e1b…

Merge pull request #43 from Norconex/snyk-upgrade-e965eb8a7e7fca80e1b… #159

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
env:
# BUCKET_NAME : "<example-bucket-name>"
AWS_REGION: ${{ secrets.AWS_REGION }}
SITE_S3_URI: ${{ secrets.SITE_S3_URI }}
jobs:
build:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Source checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and publish to Apache Maven Central
run: mvn -B deploy org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Norconex_commons-lang
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: Copy site resources to s3
run: |
aws s3 cp /home/runner/work/commons-lang/commons-lang/target/site/CHANGES.xml ${{ env.SITE_S3_URI }}commons/lang/v3/