From 68c3491cf3f9b005ca416ba8b321a60f9def3b3d Mon Sep 17 00:00:00 2001 From: zeke <40004347+KAJdev@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:18:16 -0700 Subject: [PATCH] ci: announce runtime releases and track them in Linear --- .github/workflows/images.yml | 8 ++- .github/workflows/release.yml | 110 +++++++++++++++++++++++++++++++++- README.md | 12 ++++ 3 files changed, 126 insertions(+), 4 deletions(-) diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index 340514a..af04972 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -1,8 +1,12 @@ name: Images on: - release: - types: [published] + workflow_call: + secrets: + DOCKERHUB_USERNAME: + required: true + DOCKERHUB_TOKEN: + required: true workflow_dispatch: inputs: tag: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fbbd24f..422a7b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,8 @@ name: Release on: push: branches: [main] + release: + types: [published] workflow_dispatch: permissions: @@ -13,6 +15,7 @@ permissions: jobs: release: + if: github.event_name != 'release' runs-on: ubuntu-latest outputs: release_created: ${{ steps.release.outputs.release_created }} @@ -29,9 +32,24 @@ jobs: with: token: ${{ steps.app-token.outputs.token }} - publish-package: + linear-sync-main: needs: release - if: needs.release.outputs.release_created == 'true' + if: needs.release.outputs.release_created != 'true' + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - uses: linear/linear-release-action@v0 + with: + access_key: ${{ secrets.LINEAR_RELEASE_ACCESS_KEY }} + command: sync + + publish-package: + if: github.event_name == 'release' runs-on: ubuntu-latest environment: name: pypi-production @@ -51,3 +69,91 @@ jobs: - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 + + publish-images: + if: github.event_name == 'release' + permissions: + contents: read + uses: ./.github/workflows/images.yml + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + + linear-sync: + if: github.event_name == 'release' + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - uses: linear/linear-release-action@v0 + with: + access_key: ${{ secrets.LINEAR_RELEASE_ACCESS_KEY }} + command: sync + version: ${{ github.event.release.tag_name }} + name: sdk-runtime ${{ github.event.release.tag_name }} + links: ${{ github.event.release.html_url }} + + linear-complete: + if: github.event_name == 'release' + needs: [publish-package, publish-images, linear-sync] + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - uses: linear/linear-release-action@v0 + with: + access_key: ${{ secrets.LINEAR_RELEASE_ACCESS_KEY }} + command: complete + version: ${{ github.event.release.tag_name }} + + notify: + if: github.event_name == 'release' + needs: [publish-package, publish-images] + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Build Slack notification + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + RELEASE_URL: ${{ github.event.release.html_url }} + RELEASE_BODY: ${{ github.event.release.body }} + run: | + python3 - <<'PY' + import json + import os + from pathlib import Path + + title = f"sdk-runtime {os.environ['RELEASE_TAG']} released" + notes = os.environ['RELEASE_BODY'].strip() or "See the release for details." + if len(notes) > 2800: + notes = notes[:2800] + "\n... see the full release for more." + payload = { + "text": title, + "blocks": [ + {"type": "header", "text": {"type": "plain_text", "text": title[:150]}}, + {"type": "section", "text": {"type": "plain_text", "text": notes}}, + {"type": "actions", "elements": [ + {"type": "button", "text": {"type": "plain_text", "text": "View release"}, + "url": os.environ['RELEASE_URL']} + ]}, + ], + } + Path("slack_payload.json").write_text(json.dumps(payload)) + PY + + - name: Send release notification + uses: slackapi/slack-github-action@v2.1.1 + with: + errors: true + webhook: ${{ secrets.SLACK_RELEASE_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload-file-path: ./slack_payload.json diff --git a/README.md b/README.md index d1e58da..24e1037 100644 --- a/README.md +++ b/README.md @@ -85,3 +85,15 @@ docker build \ Conventional commits drive release-please. A release publishes the Python package and versioned Docker images, then advances the corresponding `latest` tags. + +Merges to `main` sync linked issues into the scheduled Linear release pipeline. +Published GitHub releases attach their version and release link in Linear. After +the Python package and all images publish successfully, the release is marked +complete in Linear and announced in Slack with release notes and a release link. + +Configure these GitHub Actions secrets for release tracking and notifications: + +- `LINEAR_RELEASE_ACCESS_KEY`: the access key for the SDK runtime's scheduled + Linear release pipeline. +- `SLACK_RELEASE_WEBHOOK_URL`: the incoming webhook for the release announcement + channel.