Hi All , I am actually setting up github action f...
# multiplatform
a
Hi All , I am actually setting up github action for KMMBridge which basically read( I use touchlab/read-property for that) and then increases the Library version declared in gradle.properties , and then it call Base-Publish.yml. The issue is though it successfully read and bump the version but then also for some reason Base-Publish uses the old library-version from the gradle properties. This is how my current yml file looks like 🧵
Copy code
name: Version Bump & Trigger Publish

on:
  pull_request:
    branches:
      - develop

permissions:
  contents: write
  pull-requests: write

jobs:
  bump-version:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Read current version
        uses: touchlab/read-property@0.1
        id: versionPropertyValue
        with:
          file: ./gradle.properties
          property: LIBRARY_VERSION

      - name: Print Current Version
        run: echo "Current Version:${{ steps.versionPropertyValue.outputs.propVal }}"

      - name: Bump Version (Alpha)
        id: bump-version
        run: |
          CURRENT_VERSION="${{ steps.versionPropertyValue.outputs.propVal }}"

          # Extract major, minor, patch, and pre-release version (e.g., 0.0.2-alpha.3)
          VERSION_PARTS=($(echo "$CURRENT_VERSION" | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)-(.+)\.([0-9]+)/\1 \2 \3 \4 \5/'))
          
          MAJOR=${VERSION_PARTS[0]}
          MINOR=${VERSION_PARTS[1]}
          PATCH=${VERSION_PARTS[2]}
          PRERELEASE=${VERSION_PARTS[3]}
          PRERELEASE_NUM=${VERSION_PARTS[4]}

          # Increment the pre-release number (e.g., 0.0.2-alpha.3 → 0.0.2-alpha.4)
          NEW_PRERELEASE_NUM=$((PRERELEASE_NUM + 1))
          NEW_VERSION="$MAJOR.$MINOR.$PATCH-$PRERELEASE.$NEW_PRERELEASE_NUM"

          echo "New Version: $NEW_VERSION"
          echo "new_version=$NEW_VERSION" >> $GITHUB_ENV

      - name: Update gradle.properties
        run: |
          sed -i "s/^LIBRARY_VERSION=.*/LIBRARY_VERSION=${{ env.new_version }}/" gradle.properties

      - name: Commit & Push New Version
        run: |
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git add gradle.properties
          git commit -m "Bump version to ${{ env.new_version }}"
          git push origin HEAD:${{ github.head_ref }}

  trigger-publish:
    needs: bump-version
    permissions:
      contents: write
      packages: write
    uses: ./.github/workflows/Base-Publish.yml
    with:
      build-debug: true
Update: - I tried passing the version number as parameter in Build-Publish.yml, I works but except for Build Main, which still somehow use the old version no.
m
Have you checked auto release using https://github.com/semantic-release/semantic-release from commits messages that are written in https://www.conventionalcommits.org/en/v1.0.0/