Update devnet-bundle-snapshot.yml #7
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
name: devnet-bundle-snapshot | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- id: checkout | |
uses: actions/checkout@v2 | |
- id: cache-node | |
name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
'**/node' | |
'**/node_modules' | |
~/.m2/repository | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }} | |
- id: setup | |
name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- id: create_settings_xml | |
name: Create settings.xml | |
uses: whelk-io/maven-settings-xml-action@v18 | |
with: | |
repositories: > | |
[ | |
{ | |
"id": "central", | |
"url": "http://central", | |
"releases": { | |
"enabled": "true" | |
}, | |
"snapshots": { | |
"enabled": "true" | |
} | |
} | |
] | |
plugin_repositories: > | |
[ | |
{ | |
"id": "central", | |
"url": "http://central", | |
"releases": { | |
"enabled": "true" | |
}, | |
"snapshots": { | |
"enabled": "true" | |
} | |
} | |
] | |
servers: > | |
[ | |
{ | |
"id": "${{ secrets.NEXUS_ID }}", | |
"username": "${{ secrets.NEXUS_USER }}", | |
"password": "${{ secrets.NEXUS_USER_PW }}" | |
} | |
] | |
mirrors: > | |
[ | |
{ | |
"id": "${{ secrets.NEXUS_ID }}", | |
"mirrorOf": "central", | |
"url": "${{ secrets.NEXUS_URL }}" | |
} | |
] | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: | | |
~/.node | |
~/.node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- id: project_version | |
name: Extract Maven project version | |
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) | |
- id: project_artifact_id | |
name: Extract Maven project artifactId | |
run: echo ::set-output name=artifactId::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' --non-recursive exec:exec) | |
- id: tests | |
name: Run tests | |
run: mvn prepare-package -Prun-js-tests,include-mapapps-deps | |
- id: nexus_deployment | |
name: Publish to Nexus | |
run: mvn deploy -Pcompress -Dmaven.test.skip.exec=true -Ddist.releases.id=${{ secrets.NEXUS_ID }} -Ddist.releases.url=${{ secrets.NEXUS_URL_RELEASE }} -Ddist.snapshots.id=${{ secrets.NEXUS_ID }} -Ddist.snapshots.url=${{ secrets.NEXUS_URL_SNAPSHOTS }} | |
- id: release | |
name: Create GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "target/${{ steps.project_artifact_id.outputs.artifactId }}-bundle.zip,target/${{ steps.project_artifact_id.outputs.artifactId }}-sample-app.zip" | |
preRelease: true | |
bodyFile: "RELEASE.md" | |
allowUpdates: true | |
replacesArtifacts: true | |
tag: ${{ steps.project_version.outputs.version }} | |
token: ${{ secrets.RELEASE_TOKEN }} |