-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
45e2f3d
commit 24a0009
Showing
1 changed file
with
111 additions
and
0 deletions.
There are no files selected for viewing
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,111 @@ | ||
name: devnet-bundle-snapshot | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
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 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
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 }} |