forked from geosolutions-it/MapStore2
-
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.
Created actions to update gs versions (geosolutions-it#10016)
- Loading branch information
1 parent
847d375
commit a6828a2
Showing
1 changed file
with
60 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,60 @@ | ||
name: Update GS dependency versions | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
mapfish-version: | ||
description: Mapfish print version to use (e.g. 2.4-SNAPSHOT) | ||
required: true | ||
geostore-version: | ||
description: GeoStore version to use (e.g. 2.2-SNAPSHOT). | ||
required: true | ||
http-proxy-version: | ||
description: Http proxy version to use (e.g. 1.5-SNAPSHOT). | ||
required: true | ||
jobs: | ||
update-versions: | ||
name: Uptate GS dependency versions (Mapfish, GeoStore, Http Proxy) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.main-branch }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Updte versions | ||
id: create-versions | ||
env: | ||
MAPFISH_GROUP: org.mapfish.print | ||
MAPFISH_VERSION: ${{ github.event.inputs.mapfish-version }} | ||
GEOSTORE_GROUP: it.geosolutions.geostore | ||
GEOSTORE_VERSION: ${{ github.event.inputs.geostore-version }} | ||
HTTP_PROXY_GROUP: proxy | ||
HTTP_PROXY_VERSION: ${{ github.event.inputs.http-proxy-version }} | ||
RELEASE_BRANCH: ${{ github.event.inputs.release-branch }} | ||
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MAIN_BRANCH: ${{ github.event.inputs.main-branch }} | ||
PR_OPTIONS: ${{ github.event.inputs.pr-options }} | ||
RUN_ID: ${{ github.run_id }} | ||
|
||
run: | | ||
# script will go here | ||
echo "Initializing git" | ||
# Optional | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
# Find all pom.xml files and update-dependencies on them | ||
echo "Updating versions of dependencies in all pom.xml files to versions mapfish: $MAPFISH_VERSION, geostore: $GEOSTORE_VERSION, http-proxy: $HTTP_PROXY_VERSION" | ||
POM_FILES=$(git ls-files . | grep 'pom\.xml$' | grep -v 'project/standard/templates/backend/pom\.xml$'| grep -v 'project/standard/templates/pom\.xml$');# note: exclues one file not involved that is not valid pom.xml, because it is a template | ||
for POM_FILE in $POM_FILES; do | ||
mvn versions:use-dep-version -f $POM_FILE -Dincludes=$MAPFISH_GROUP -DdepVersion=$MAPFISH_VERSION -DforceVersion=true -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting | ||
mvn versions:use-dep-version -f $POM_FILE -Dincludes=$GEOSTORE_GROUP -DdepVersion=$GEOSTORE_VERSION -DforceVersion=true -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting | ||
mvn versions:use-dep-version -f $POM_FILE -Dincludes=$HTTP_PROXY_GROUP -DdepVersion=$HTTP_PROXY_VERSION -DforceVersion=true -DgenerateBackupPoms=false -DautoVersionSubmodules=true -Pprinting | ||
done | ||
echo $POM_FILES | xargs git add | ||
if ! git diff-index --quiet HEAD; then | ||
git commit -m "Set versions of main dependencies (geostore, mapfish, http-proxy)" | ||
else | ||
echo "::notice::No version changes in dependencies to commit. Please make sure to make this version fixed later" | ||
fi | ||
git push origin ${{ github.ref_name }} |