Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
110 changes: 108 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Release
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:

permissions:
Expand All @@ -13,6 +15,7 @@ permissions:

jobs:
release:
if: github.event_name != 'release'
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
Expand All @@ -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
Expand All @@ -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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading