From eae811e35b96579358c2cc44cd7874bd17c83c3b Mon Sep 17 00:00:00 2001 From: William Dutton Date: Fri, 7 Jun 2024 15:03:41 +1000 Subject: [PATCH] all in one --- .github/workflows/githubPackage.yml | 59 +++++------------------------ 1 file changed, 9 insertions(+), 50 deletions(-) diff --git a/.github/workflows/githubPackage.yml b/.github/workflows/githubPackage.yml index 6c5f639..b045eae 100644 --- a/.github/workflows/githubPackage.yml +++ b/.github/workflows/githubPackage.yml @@ -1,7 +1,7 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages -name: Publish NPM Github Package store +name: Publish Maven Github Package store on: push: @@ -19,54 +19,7 @@ on: - Yes jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - jdk: [ '21' ] - name: Lint, Test, Build and Deploy on Node ${{ matrix.jdk }} - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK ${{ matrix.jdk }} - uses: actions/setup-java@v4 - with: - distribution: 'zulu' # See 'Supported distributions' for available options - java-version: '${{ matrix.jdk }}' - - - name: Cache Maven packages - id: cache-maven - uses: actions/cache@v2 - with: - path: ~/.m2/repository -# save-always: true - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }} - - - name: Get Versions - run: | - echo "Google chrome version" - google-chrome --version - echo "firefox version" - firefox --version - echo "temp folder: ${{ runner.temp }}" - - - name: Build with Maven - run: mvn --batch-mode --update-snapshots verify -Djava.io.tmpdir=${{ runner.temp }} - env: - NVD_NIST_APIKEY: ${{ secrets.NVD_NIST_APIKEY}} - - - run: mkdir dist && cp target/*.jar dist - - - uses: actions/upload-artifact@v4 - with: - name: Package - path: dist - - publish-gpr: - needs: build env: #When run on push tags, force is '', default for workflow_dispatch is No so you can't trigger without a double action DO_DEPLOYMENT: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.force == 'Yes' }} @@ -75,14 +28,18 @@ jobs: contents: read packages: write id-token: write + strategy: + matrix: + jdk: [ '21' ] + name: Lint, Test, Build and Deploy on Node ${{ matrix.jdk }} steps: - uses: actions/checkout@v4 - - name: Set up JDK 21 + - name: Set up JDK ${{ matrix.jdk }} uses: actions/setup-java@v4 with: distribution: 'zulu' # See 'Supported distributions' for available options - java-version: '21' + java-version: '${{ matrix.jdk }}' - name: Cache Maven packages id: cache-maven @@ -104,6 +61,8 @@ jobs: - name: Build with Maven run: mvn --batch-mode --update-snapshots verify -Djava.io.tmpdir=${{ runner.temp }} + env: + NVD_NIST_APIKEY: ${{ secrets.NVD_NIST_APIKEY}} - run: mkdir dist && cp target/*.jar dist