Bump up version #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bump up version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| versionName: | |
| required: true | |
| description: "New version name" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| execute: | |
| runs-on: macOS-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Validate Gradle Wrapper | |
| uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 | |
| - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/configuration-cache | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Bump up version | |
| run: | | |
| FILE="gradle/libs.versions.toml" | |
| current_version=$(awk -F'=' '/versionCode/ {gsub(/"/, "", $2); gsub(/ /, "", $2); print $2}' "$FILE") | |
| new_versionName="${{ github.event.inputs.versionName }}" | |
| new_versionCode="$((current_version + 1))" | |
| sed -i '' "s/versionName *= *\".*\"/versionName = \"$new_versionName\"/" "$FILE" | |
| sed -i '' "s/versionCode *= *\".*\"/versionCode = \"$new_versionCode\"/" "$FILE" | |
| cat ./gradle/libs.versions.toml | head -5 | |
| - name: Make XCFramework | |
| run: ./gradlew assemblePureeKMPXCFramework | |
| - name: Zip XCFramework | |
| run: | | |
| zip -r PureeKMP.xcframework.zip PureeKMP.xcframework/ | |
| working-directory: puree/build/XCFrameworks/release | |
| - name: Make Package.swift | |
| run: | | |
| chmod +x ./make_package.sh | |
| ./make_package.sh ${{ github.event.inputs.versionName }} | |
| working-directory: config/swift/ | |
| - name: Create tag | |
| uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b # v6.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| custom_tag: v${{ github.event.inputs.versionName }} | |
| dry_run: true | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 | |
| with: | |
| title: "[skip ci] Bump up version to v${{ github.event.inputs.versionName }}" | |
| body: | | |
| :sparkles: :sparkles: Bump up version in puree-kmp to **v${{ github.event.inputs.versionName }}**! :sparkles: :sparkles: | |
| labels: Release |