diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index b40f62d..17eaebc 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -2,37 +2,9 @@ name: Maven Publish 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: Update Version - run: | - sed -i '/VERSION=/!b;cVERSION=\"v${{ github.event.inputs.libraryVersion }}";' ./download-libs.sh - - name: Commit, Tag and Push - run: | - git add ./download-libs.sh - git config user.name github-actions - git config user.email github-actions@github.com - git commit -m "updated version" | exit 0 - git tag ${{ github.event.inputs.packageVersion }} - git push & git push --tags - publish: - needs: update-version runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 0000000..f55b7ca --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,36 @@ +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 + - name: Commit, Tag and Push + run: | + git add ./download-libs.sh + git config user.name github-actions + git config user.email github-actions@github.com + git commit -m "updated version" | exit 0 + git tag ${{ github.event.inputs.packageVersion }} + git push --set-upstream origin release/${{ github.event.inputs.packageVersion }} + git push --tags \ No newline at end of file