-
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
5 changed files
with
179 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,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 | ||
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