From 46a73f9e9e5270d1f3afc5c18f71526437db7b09 Mon Sep 17 00:00:00 2001 From: Ahmad Kemsan Date: Wed, 5 Nov 2025 11:53:48 +0530 Subject: [PATCH] ci: update ci workflow to push version updates to release branch --- .github/workflows/publish.yml | 29 --------------------- .github/workflows/update-version.yml | 38 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/update-version.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fca8c40..319f7d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,38 +2,9 @@ name: AAR 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..3c60287 --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,38 @@ +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