Hi guys, is there any docs that can use autoVersio...
# touchlab-tools
i
Hi guys, is there any docs that can use autoVersion with KMMBridgeSKIETemplate when build with github action? I got a issue
Copy code
> Failed to publish publication 'KMMBridgeFramework' to repository 'GitHubPackages'
   > Could not PUT '<https://maven.pkg.github.com/tddworks/lemonsqueezy-kotlin/com/snacks/lemonsqueezy/shared-kmmbridge/0.1/shared-kmmbridge-0.1.zip>'. Received status code 409 from server: Conflict
https://github.com/touchlab/KMMBridgeSKIETemplate/blob/main/build.gradle.kts
Copy code
val autoVersion = project.property(
    if (project.hasProperty("AUTO_VERSION")) {
        "AUTO_VERSION"
    } else {
        "LIBRARY_VERSION"
    }
p
Based on your comment on my other message you probably already figured this out, but in case it’s helpful for anyone else: The “Conflict” here is because the published artifacts are missing the patch version, causing them to all have the same version. After the first publish, all subsequent publishes will fail due to the conflicting version.
AUTO_VERSION
(base version + incremented patch version) is set by the GH workflow when it publishes the app, so its presence needs to be checked when setting the publish version in
build.gradle
.
i
I found that from - https://github.com/touchlab/KMMBridgeGithubWorkflow/blob/main/.github/workflows/faktorybuildautoversion.yml
Copy code
- name: Build Main
        run: ./gradlew ${{ env.MODULE }}${{ inputs.publishTask }} -PAUTO_VERSION=${{ steps.autoversion.outputs.nextVersion }} -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} ${{ secrets.gradle_params }} --no-daemon --stacktrace
Note: PENABLE_PUBLISHING=true will release new tag with
Packag.swift
which contains binaryTarget using remote url