From e3320a665ce28a5457a33dd5f2e89d8dfa03407e Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Fri, 2 Jan 2026 14:49:05 +0530 Subject: [PATCH 1/2] ci: automate PR bump creation, slack notification --- .github/workflows/publish.yml | 19 ++++++++++++++++- .github/workflows/update-version.yml | 32 ++++++++++++++++------------ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a36cb96..67d53a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,8 @@ on: jobs: publish: runs-on: ubuntu-latest + env: + PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }} steps: - uses: actions/checkout@v2 @@ -39,4 +41,19 @@ jobs: ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }} - run: ./gradlew lexfloatclient:publishAndReleaseToMavenCentral -PlexVersion=${{github.event.inputs.packageVersion}} --info --warning-mode all + run: ./gradlew lexfloatclient:publishAndReleaseToMavenCentral -PlexVersion=${{ env.PACKAGE_VERSION }} --info --warning-mode all + + - name: Extract version and create tag + run: | + git tag "${{ env.PACKAGE_VERSION }}" 2>/dev/null || echo "Tag already exists" + git push origin "${{ env.PACKAGE_VERSION }}" || true + + - name: Notify slack releases channel + uses: slackapi/slack-github-action@v2 + with: + webhook: ${{ secrets.SLACK_RELEASES_PROD_WEBHOOK_URL }} + webhook-type: webhook-trigger + payload: | + status: "${{ job.status }}" + environment: "PRODUCTION" + project: "LexFloatClient Android" \ No newline at end of file diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 3c60287..540b5a3 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -16,23 +16,27 @@ jobs: update-version: runs-on: ubuntu-latest + env: + LIBRARY_VERSION: ${{ github.event.inputs.libraryVersion }} + PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }} + steps: - name: Checkout code - uses: actions/checkout@v2 - - - name: Create new branch - run: git checkout -b release/${{ github.event.inputs.packageVersion }} + uses: actions/checkout@v4 - 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 + sed -i -E 's/^([[:space:]]*)VERSION="[^"]*"/\1VERSION="v${{ env.LIBRARY_VERSION }}"/' ./download-libs.sh + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + branch: ci/${{ env.PACKAGE_VERSION }} + title: "chore: bump package version to ${{ env.PACKAGE_VERSION }}" + commit-message: "chore(package version): updated version" + body: | + Automated package version bump. + base: main + add-paths: | + ./download-libs.sh \ No newline at end of file From aa3947c1ea89c89ac2b5f3df8714cadbc6529590 Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Fri, 2 Jan 2026 16:12:56 +0530 Subject: [PATCH 2/2] ci: update checkout action --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 67d53a0..50d9f55 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: env: PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: git pull origin main --ff-only