Skip to content

Commit

Permalink
Create devnet-bundle-snapshot.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasstein authored Nov 8, 2021
1 parent 66ce68f commit 1b7badb
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/devnet-bundle-snapshot.yml
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 }}

0 comments on commit 1b7badb

Please sign in to comment.