-
Notifications
You must be signed in to change notification settings - Fork 239
Fix uniffi release: publish directly via knope, react on the release event #1256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,64 +1,53 @@ | ||
| name: UniFFI packages | ||
|
|
||
| # Orchestrates per-language wrapper-package publishing on knope draft releases | ||
| # for the livekit-uniffi crate. Resolves the source tag once, then delegates | ||
| # to per-language reusable workflows (uniffi-swift.yml today; uniffi-kotlin.yml | ||
| # / uniffi-python.yml would slot in as additional jobs). | ||
| # Publishes the per-language livekit-uniffi wrapper packages (Swift xcframework → | ||
| # livekit/livekit-uniffi-xcframework; Android AAR → Maven Central) when a | ||
| # livekit-uniffi release is published. | ||
| # | ||
| # Trigger pattern mirrors ffi-builds.yml: every push to main checks for a | ||
| # draft release with prefix `livekit-uniffi/v`; workflow_dispatch allows | ||
| # manual runs with an explicit tag. | ||
| # knope publishes the `livekit-uniffi/v*` GitHub release (and its git tag) | ||
| # directly on the release merge — no draft — so this reacts to the published | ||
| # release event, which fires only for genuine livekit-uniffi releases (the gate | ||
| # is free). workflow_dispatch allows a manual re-run with an explicit tag. | ||
| # | ||
| # The Dart/Flutter cdylib target is experimental and not published for now; add a | ||
| # `cdylib` job (uniffi-cdylib.yml) back when it ships. | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag_name: | ||
| description: "Release tag (e.g., livekit-uniffi/v0.0.7). Required if no draft release exists." | ||
| required: false | ||
| description: "Release tag (e.g. livekit-uniffi/v0.1.6)" | ||
| required: true | ||
| type: string | ||
| dry_run: | ||
| description: "Build artifacts but skip release upload/PR." | ||
| description: "Build artifacts but skip publishing." | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| TAG_PREFIX: livekit-uniffi/v | ||
|
|
||
| jobs: | ||
| resolve-tag: | ||
| runs-on: ubuntu-latest | ||
| # The release event fires for every package's release, so proceed only for | ||
| # livekit-uniffi. workflow_dispatch always proceeds (explicit tag). | ||
| if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'livekit-uniffi/v') }} | ||
| outputs: | ||
| tag_name: ${{ steps.get-tag.outputs.tag_name }} | ||
| version: ${{ steps.get-tag.outputs.version }} | ||
| steps: | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| - id: get-tag | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| MANUAL_TAG="${{ inputs.tag_name }}" | ||
| if [ -n "$MANUAL_TAG" ]; then | ||
| TAG="$MANUAL_TAG" | ||
| echo "Using manually provided tag: '$TAG'" | ||
| else | ||
| TAG=$(gh release list --repo "${{ github.repository }}" \ | ||
| --json 'isDraft,tagName' \ | ||
| --jq "[.[] | select(.isDraft and (.tagName | startswith(\"${TAG_PREFIX}\")))] | first | .tagName // empty") | ||
| echo "Resolved livekit-uniffi draft release tag: '${TAG:-<none>}'" | ||
| fi | ||
| TAG="${{ github.event.release.tag_name || inputs.tag_name }}" | ||
| echo "tag_name=${TAG}" >> "$GITHUB_OUTPUT" | ||
| # Strip the "livekit-uniffi/v" prefix to get the hosting-repo tag (e.g., 0.0.7) | ||
| VERSION="${TAG#${TAG_PREFIX}}" | ||
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | ||
| # Strip the "livekit-uniffi/v" prefix to get the package version (e.g. 0.1.6). | ||
| echo "version=${TAG#livekit-uniffi/v}" >> "$GITHUB_OUTPUT" | ||
|
Comment on lines
43
to
+47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟨 Release tag name is interpolated directly into a shell command The new resolve-tag step embeds the release tag straight into a shell assignment ( Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| swift: | ||
| needs: resolve-tag | ||
| if: needs.resolve-tag.outputs.tag_name != '' | ||
| uses: ./.github/workflows/uniffi-swift.yml | ||
| with: | ||
| version: ${{ needs.resolve-tag.outputs.version }} | ||
|
|
@@ -69,26 +58,9 @@ jobs: | |
|
|
||
| android: | ||
| needs: resolve-tag | ||
| if: needs.resolve-tag.outputs.tag_name != '' | ||
| uses: ./.github/workflows/uniffi-android.yml | ||
| with: | ||
| version: ${{ needs.resolve-tag.outputs.version }} | ||
| tag_name: ${{ needs.resolve-tag.outputs.tag_name }} | ||
| dry_run: ${{ inputs.dry_run || false }} | ||
| secrets: inherit | ||
|
|
||
| # Raw cdylibs for the Dart package's build-hook download (build-<triple>.zip). | ||
| cdylib: | ||
| needs: resolve-tag | ||
| if: needs.resolve-tag.outputs.tag_name != '' | ||
| # The reusable workflow uploads to this repo's release via github.token; a | ||
| # called workflow can't elevate the caller's token, so grant write here (the | ||
| # top-level default is read). Swift uses a PAT and Android uses Maven, so | ||
| # neither needs this. | ||
| permissions: | ||
| contents: write | ||
| uses: ./.github/workflows/uniffi-cdylib.yml | ||
| with: | ||
| version: ${{ needs.resolve-tag.outputs.version }} | ||
| tag_name: ${{ needs.resolve-tag.outputs.tag_name }} | ||
| dry_run: ${{ inputs.dry_run || false }} | ||
Uh oh!
There was an error while loading. Please reload this page.