Skip to content

Update version

Update version #3

name: Update version
on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'Library Version'
required: true
default: ''
packageVersion:
description: 'Package Version'
required: true
default: ''
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create new branch
run: git checkout -b release/${{ github.event.inputs.packageVersion }}
- name: Update Version
run: |
sed -i '/VERSION=/!b;cVERSION=\"v${{ github.event.inputs.libraryVersion }}";' ./download-libs.sh
sed -i '/<packaging>jar<\/packaging>/,/<name>/s/<version>[^<]*<\/version>/<version>${{ github.event.inputs.libraryVersion }}<\/version>/' pom.xml
- name: Commit, Tag and Push
run: |
git add ./download-libs.sh
git add pom.xml
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "chore(package version): updated version" | exit 0
git tag ${{ github.event.inputs.packageVersion }}
git push --set-upstream origin release/${{ github.event.inputs.packageVersion }}
git push --tags