-
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
1 parent
b42026a
commit 66ce68f
Showing
1 changed file
with
133 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,133 @@ | ||
name: devnet-bundle-release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseVersion: | ||
description: "Release version" | ||
required: true | ||
nextDevVersion: | ||
description: "Next SNAPSHOT version" | ||
required: true | ||
|
||
env: | ||
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }} | ||
NEXT_DEV_VERSION: ${{ github.event.inputs.nextDevVersion }} | ||
|
||
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: git | ||
name: Set GIT username and email | ||
run: | | ||
git config --global user.email "${{ secrets.GIT_MAIL }}" | ||
git config --global user.name "${{ secrets.GIT_USER }}" | ||
- 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_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: write_release_versions | ||
name: Update versions to ${{ env.RELEASE_VERSION }} | ||
run: | | ||
mvn validate -P write-release-versions -Dreplace.target.version=${{ env.RELEASE_VERSION }} | ||
mvn versions:set -DnewVersion=${{ env.RELEASE_VERSION }} -DgenerateBackupPoms=false | ||
mvn scm:checkin -DpushChanges=false -Dmessage="[update-version] to ${{ env.RELEASE_VERSION }}" -Dscm.username=${{ secrets.GIT_USER }} -Dscm.password=${{ secrets.RELEASE_TOKEN }} | ||
- 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: false | ||
bodyFile: "RELEASE.md" | ||
allowUpdates: true | ||
replacesArtifacts: true | ||
tag: ${{ env.RELEASE_VERSION }} | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
- id: write_dev_versions | ||
name: Update versions to ${{ env.NEXT_DEV_VERSION }} | ||
run: | | ||
mvn validate -P write-release-versions -Dreplace.target.version=${{ env.NEXT_DEV_VERSION }} | ||
mvn versions:set -DnewVersion=${{ env.NEXT_DEV_VERSION }} -DgenerateBackupPoms=false | ||
mvn scm:checkin -DpushChanges=true -Dmessage="[update-version] to ${{ env.NEXT_DEV_VERSION }}" -Dscm.username=${{ secrets.GIT_USER }} -Dscm.password=${{ secrets.RELEASE_TOKEN }} |