https://kotlinlang.org logo
#touchlab-tools
Title
# touchlab-tools
b

Bradleycorn

11/04/2023, 9:35 PM
I’m using the KMMBridge Template (https://github.com/touchlab/KMMBridgeSKIETemplate) and I have the initial setup working. I’ve updated the
all-publish
workflow to add an additional step after the publish that creates a release in my github repo. I’d like to have it set the name of the release to the tag/version number that was used when the first step published all of the packages. Is there some way to get the tag/version number that the “default github workflow” uses to publish? My workflow file is posted in the 🧵
Here’s my workflow yaml file:
Copy code
name: Publish All
on:
  workflow_dispatch:
#  push:
#    branches:
#      - "main"
jobs:
  kmmbridge-publish:
    permissions:
      contents: write
      packages: write
    steps:
      - name: Publish
        uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/faktorybuildautoversion.yml@v1.0
        with:
          jvmVersion: 17
          versionBaseProperty: LIBRARY_VERSION
          publishTask: kmmBridgePublish publishKotlinMultiplatformPublicationToGitHubPackagesRepository publishAndroidDebugPublicationToGitHubPackagesRepository publishAndroidReleasePublicationToGitHubPackagesRepository
#          secrets:
#             PODSPEC_SSH_KEY: ${{ secrets.PODSPEC_SSH_KEY }}
      - name: Create Release
        uses: ncipollo/release-action@v1
        with:
          allowUpdates: true
          updateOnlyUnreleased: true
          draft: false
          commit: ${{ github.ref_name }}
          tag: ???? I need the tag that was created in the previous step
          name: ?? I need the version (or tag) that was created in the previous step
          omitBodyDuringUpdate: true
          bodyFile: "These are some release notes ... "
Maybe I could copy a few of the steps that calculate the next version number out of the faktorybuildautoversion.yml (from the default github workflow), and then add them in my own workflow file (before the publish step). Then I could use the output of those to get the version (which should be the same as what ends up getting published)?
Copy code
- uses: touchlab/read-property@0.1
        id: versionBasePropertyValue
        with:
          file: ./gradle.properties
          property: ${{ inputs.versionBaseProperty }}
      - uses: touchlab/autoversion-nextversion@main
        id: autoversion
        with:
          versionBase: ${{ steps.versionBasePropertyValue.outputs.propVal }}

// Then in my create release step I could use:
${{ steps.autoversion.outputs.nextVersion }}