From 1b7badbf9c1ab54458243216d76a24fa5a2ced92 Mon Sep 17 00:00:00 2001 From: Matthias Stein Date: Mon, 8 Nov 2021 14:47:54 +0100 Subject: [PATCH] Create devnet-bundle-snapshot.yml --- .github/workflows/devnet-bundle-snapshot.yml | 111 +++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .github/workflows/devnet-bundle-snapshot.yml diff --git a/.github/workflows/devnet-bundle-snapshot.yml b/.github/workflows/devnet-bundle-snapshot.yml new file mode 100644 index 0000000..08b2aab --- /dev/null +++ b/.github/workflows/devnet-bundle-snapshot.yml @@ -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 }}