Skip to content

Commit

Permalink
make jdk21 only
Browse files Browse the repository at this point in the history
  • Loading branch information
duttonw committed Jun 6, 2024
1 parent 69bf891 commit 9f6bc77
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 111 deletions.
57 changes: 0 additions & 57 deletions .circleci/config.yml

This file was deleted.

33 changes: 1 addition & 32 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,4 @@ updates:
interval: daily
time: "19:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: org.owasp:dependency-check-maven
versions:
- 6.1.2
- 6.1.3
- 6.1.4
- dependency-name: net.sourceforge.htmlunit:htmlunit
versions:
- 2.46.0
- 2.48.0
- dependency-name: org.seleniumhq.selenium:htmlunit-driver
versions:
- 2.46.0
- 2.48.0
- dependency-name: net.sourceforge.pmd:pmd-java
versions:
- 6.30.0
- 6.32.0
- dependency-name: net.sourceforge.pmd:pmd-core
versions:
- 6.30.0
- 6.32.0
- dependency-name: com.puppycrawl.tools:checkstyle
versions:
- "8.39"
- "8.41"
- dependency-name: org.assertj:assertj-core
versions:
- 3.19.0
- dependency-name: io.github.bonigarcia:webdrivermanager
versions:
- 4.3.1

131 changes: 131 additions & 0 deletions .github/workflows/githubPackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# 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

on:
push:
#On versioned releases
tags:
- v*.*.*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
force:
type: choice
description: Retry Publish Version
options:
- No
- 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: Cache Maven packages
id: cache-nvm
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- 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: 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 }}

- 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' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4

- name: Cache Maven packages
id: cache-nvm
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '21'

- 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 }}

- run: mkdir dist && cp target/*.jar dist

- uses: actions/upload-artifact@v4
with:
name: Package
path: dist

- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
run: npm publish --provenance --access=public --tag ${{ steps.latest_tag.outputs.latest-tag }}
if: ${{ env.DO_DEPLOYMENT == 'true' }}
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Publish - Skipped
if: ${{ env.DO_DEPLOYMENT != 'true' }}
run: |
echo "### Publish skipped" >> $GITHUB_STEP_SUMMARY
echo "DO_DEPLOYMENT( ${{ env.DO_DEPLOYMENT }} ): github.event_name: ${{ github.event_name != 'workflow_dispatch'}} || github.event.inputs.force: ${{ github.event.inputs.force == 'Yes' }}" >> $GITHUB_STEP_SUMMARY
37 changes: 24 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,39 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4

- name: Cache Maven packages
id: cache-nvm
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '21'

- name: Get Versions
run: |
echo "Google chrome version"
google-chrome --version
echo "firefox version"
firefox --version
echo "temp folder: ${{ runner.temp }}"
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify -Djava.io.tmpdir=${{ runner.temp }}
- run: mkdir staging && cp target/*.jar staging
- uses: actions/upload-artifact@v2

- run: mkdir dist && cp target/*.jar dist

- uses: actions/upload-artifact@v4
with:
name: Package
path: staging
path: dist
32 changes: 23 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,36 @@
<tag>HEAD</tag>
</scm>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/qld-gov-au/seleniumHelper</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<distributionManagement>
<repository>
<id>nexus</id>
<name>Nexus</name>
<url>https://nexus.tools.services.qld.gov.au/nexus/repository/releases</url>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/qld-gov-au/seleniumHelper</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Nexus</name>
<url>https://nexus.tools.services.qld.gov.au/nexus/repository/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<java.version>21</java.version>
<resource.delimiter>@</resource.delimiter>
<maven.compiler.source>${java.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit 9f6bc77

Please sign in to comment.