Post Release #3
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Post Release | |
on: | |
workflow_dispatch: | |
inputs: | |
snapshot: | |
description: 'Version of Java packages to restore. e.g. 2.1-SNAPSHOT' | |
required: true | |
jobs: | |
fix-version: | |
# if: ${{ github.repository == 'geosolutions-it/geostore' && github.ref != 'master' }} | |
concurrency: ci-${{ github.ref }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check branch | |
if: ${{ github.repository != 'geosolutions-it/geostore' || github.ref == 'master' }} | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('This workflow can not run on master branch') | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
cache: maven | |
- name: Restore Snapshots | |
env: | |
SNAPSHOT_VERSION: ${{ github.event.inputs.snapshot }} | |
run: | | |
# restore versions snapshot | |
echo | |
mvn versions:set -DnewVersion=$SNAPSHOT_VERSION -DprocessAllModules -DgenerateBackupPoms=false -Pprinting,binary,printingbundle | |
mvn versions:use-dep-version -f project/standard/templates/web/pom.xml -Dincludes=it.geosolutions.mapstore -DdepVersion=$SNAPSHOT_VERSION -DforceVersion=true -DgenerateBackupPoms=false | |
npm version patch --git-tag-version=false | |
find . -name 'pom.xml' | xargs git add | |
git add package.json | |
git commit -m "Restore java packages to $SNAPSHOT_VERSION and update package.json" | |
git push origin ${{ github.ref_name }} | |
echo "Snapshots version restored" |