From 4320f5ca369840c55c336b6fe5b5a81d4231a932 Mon Sep 17 00:00:00 2001 From: lanycrost Date: Sat, 18 Apr 2026 16:40:14 +0400 Subject: [PATCH 1/2] chore: harden release automation --- .github/release-please-config.json | 6 ++ .github/workflows/release-please.yml | 118 +++++++++++++++++++-------- Impulse.yaml | 4 +- 3 files changed, 91 insertions(+), 37 deletions(-) diff --git a/.github/release-please-config.json b/.github/release-please-config.json index 1f3d120..62166e6 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -5,6 +5,12 @@ "release-type": "go", "package-name": "livekit-webhook-impulse", "include-component-in-tag": false, + "extra-files": [ + { + "type": "generic", + "path": "Impulse.yaml" + } + ], "changelog-sections": [ { "type": "feat", diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 47e9a77..a0eadcd 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -4,6 +4,12 @@ on: push: branches: - main + workflow_dispatch: + inputs: + tag_name: + description: Existing release tag to publish (for example `v0.1.0`) + required: false + type: string permissions: contents: write @@ -20,42 +26,84 @@ env: jobs: release-please: runs-on: ubuntu-latest - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} steps: - name: Release Please + if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.tag_name == '' }} id: release uses: googleapis/release-please-action@v4 with: config-file: .github/release-please-config.json manifest-file: .github/.release-please-manifest.json - - name: Checkout code - if: ${{ steps.release.outputs.release_created }} + - name: Checkout workflow source uses: actions/checkout@v6 - - name: Set up Go - if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-go@v6 - with: - go-version-file: go.mod - check-latest: true - cache: true - cache-dependency-path: go.sum - - - name: Run lint and tests - if: ${{ steps.release.outputs.release_created }} + - name: Detect release context + id: publish + env: + GH_TOKEN: ${{ github.token }} run: | - make lint - make test + set -euo pipefail + + manual_tag="${{ github.event.inputs.tag_name }}" + if [ -n "${manual_tag}" ]; then + release_json="$(gh release view "${manual_tag}" --json targetCommitish,url 2>/dev/null || true)" + if [ -z "${release_json}" ]; then + echo "Release ${manual_tag} not found" >&2 + exit 1 + fi + + echo "publish=true" >> "$GITHUB_OUTPUT" + echo "tag_name=${manual_tag}" >> "$GITHUB_OUTPUT" + echo "release_url=$(printf '%s' "${release_json}" | jq -r '.url')" >> "$GITHUB_OUTPUT" + echo "checkout_ref=${manual_tag}" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if [ "${{ steps.release.outputs.release_created }}" = "true" ]; then + echo "publish=true" >> "$GITHUB_OUTPUT" + echo "tag_name=${{ steps.release.outputs.tag_name }}" >> "$GITHUB_OUTPUT" + echo "release_url=${{ steps.release.outputs.html_url }}" >> "$GITHUB_OUTPUT" + echo "checkout_ref=${{ steps.release.outputs.tag_name }}" >> "$GITHUB_OUTPUT" + exit 0 + fi + + version="$(jq -r '."."' .github/.release-please-manifest.json)" + if [ -z "${version}" ] || [ "${version}" = "null" ]; then + echo "publish=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + + tag_name="v${version}" + release_json="$(gh release view "${tag_name}" --json targetCommitish,url 2>/dev/null || true)" + if [ -z "${release_json}" ]; then + echo "publish=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + + target_commitish="$(printf '%s' "${release_json}" | jq -r '.targetCommitish')" + if [ "${target_commitish}" != "${GITHUB_SHA}" ]; then + echo "publish=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "publish=true" >> "$GITHUB_OUTPUT" + echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT" + echo "release_url=$(printf '%s' "${release_json}" | jq -r '.url')" >> "$GITHUB_OUTPUT" + echo "checkout_ref=${tag_name}" >> "$GITHUB_OUTPUT" + + - name: Checkout release source + if: ${{ steps.publish.outputs.publish == 'true' }} + uses: actions/checkout@v6 + with: + ref: ${{ steps.publish.outputs.checkout_ref }} - name: Set up Docker Buildx - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} uses: docker/setup-buildx-action@v4 - name: Log in to GitHub Container Registry - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} uses: docker/login-action@v4 with: registry: ghcr.io @@ -63,20 +111,20 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract Docker metadata - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} id: meta uses: docker/metadata-action@v6 with: images: ${{ env.GHCR_IMAGE }} tags: | - type=semver,pattern={{version}},value=${{ steps.release.outputs.tag_name }} - type=semver,pattern={{major}}.{{minor}},value=${{ steps.release.outputs.tag_name }} - type=semver,pattern={{major}},value=${{ steps.release.outputs.tag_name }} - type=raw,value=${{ steps.release.outputs.tag_name }} + type=semver,pattern={{version}},value=${{ steps.publish.outputs.tag_name }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.publish.outputs.tag_name }} + type=semver,pattern={{major}},value=${{ steps.publish.outputs.tag_name }} + type=raw,value=${{ steps.publish.outputs.tag_name }} type=raw,value=latest - name: Build and push Docker image - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} uses: docker/build-push-action@v7 with: context: . @@ -88,7 +136,7 @@ jobs: cache-to: type=gha,mode=max - name: Detect template manifest - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} id: template run: | set -euo pipefail @@ -106,22 +154,22 @@ jobs: echo "file=${template_file}" >> "$GITHUB_OUTPUT" echo "kind=${template_kind}" >> "$GITHUB_OUTPUT" echo "latest_url=https://github.com/${{ github.repository }}/releases/latest/download/${template_file}" >> "$GITHUB_OUTPUT" - echo "versioned_url=https://github.com/${{ github.repository }}/releases/download/${{ steps.release.outputs.tag_name }}/${template_file}" >> "$GITHUB_OUTPUT" + echo "versioned_url=https://github.com/${{ github.repository }}/releases/download/${{ steps.publish.outputs.tag_name }}/${template_file}" >> "$GITHUB_OUTPUT" - name: Upload template manifest to GitHub release - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} env: GH_TOKEN: ${{ github.token }} - run: gh release upload "${{ steps.release.outputs.tag_name }}" "${{ steps.template.outputs.file }}" --clobber + run: gh release upload "${{ steps.publish.outputs.tag_name }}" "${{ steps.template.outputs.file }}" --clobber - name: Summarize release - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.publish.outputs.publish == 'true' }} run: | { - echo "## Release ${{ steps.release.outputs.tag_name }} 🚀" + echo "## Release ${{ steps.publish.outputs.tag_name }} 🚀" echo - echo "- **GitHub Release**: https://github.com/${{ github.repository }}/releases/tag/${{ steps.release.outputs.tag_name }}" - echo "- **Container Image**: \`${{ env.GHCR_IMAGE }}:${{ steps.release.outputs.tag_name }}\`" + echo "- **GitHub Release**: ${{ steps.publish.outputs.release_url }}" + echo "- **Container Image**: \`${{ env.GHCR_IMAGE }}:${{ steps.publish.outputs.tag_name }}\`" echo "- **Template Kind**: \`${{ steps.template.outputs.kind }}\`" echo "- **Latest Template URL**: ${{ steps.template.outputs.latest_url }}" echo "- **Pinned Template URL**: ${{ steps.template.outputs.versioned_url }}" @@ -133,6 +181,6 @@ jobs: echo echo "### Pull the image" echo '```bash' - echo "docker pull ${{ env.GHCR_IMAGE }}:${{ steps.release.outputs.tag_name }}" + echo "docker pull ${{ env.GHCR_IMAGE }}:${{ steps.publish.outputs.tag_name }}" echo '```' } >> "$GITHUB_STEP_SUMMARY" diff --git a/Impulse.yaml b/Impulse.yaml index b307ac7..d1af1ec 100644 --- a/Impulse.yaml +++ b/Impulse.yaml @@ -5,9 +5,9 @@ metadata: annotations: registry.bubustack.io/maturity: experimental spec: - version: 0.1.0 + version: 0.1.0 # x-release-please-version description: An Impulse that listens for LiveKit webhook events and triggers a StoryRun. - image: ghcr.io/bubustack/livekit-webhook-impulse:0.1.0 + image: ghcr.io/bubustack/livekit-webhook-impulse:0.1.0 # x-release-please-version supportedModes: - deployment configSchema: From affd99c74a979fe21438c279f8088d767ad09680 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 12:44:48 +0000 Subject: [PATCH 2/2] chore(main): release 0.1.1 --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ Impulse.yaml | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 466df71..a915e8c 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.1.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c4d93..ea46dd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ This file is automatically generated by [Release Please](https://github.com/goog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.1](https://github.com/bubustack/livekit-webhook-impulse/compare/v0.1.0...v0.1.1) (2026-04-18) + + +### Miscellaneous + +* harden release automation ([4320f5c](https://github.com/bubustack/livekit-webhook-impulse/commit/4320f5ca369840c55c336b6fe5b5a81d4231a932)) + ## 0.1.0 (2026-04-18) diff --git a/Impulse.yaml b/Impulse.yaml index d1af1ec..0f1327b 100644 --- a/Impulse.yaml +++ b/Impulse.yaml @@ -5,9 +5,9 @@ metadata: annotations: registry.bubustack.io/maturity: experimental spec: - version: 0.1.0 # x-release-please-version + version: 0.1.1 # x-release-please-version description: An Impulse that listens for LiveKit webhook events and triggers a StoryRun. - image: ghcr.io/bubustack/livekit-webhook-impulse:0.1.0 # x-release-please-version + image: ghcr.io/bubustack/livekit-webhook-impulse:0.1.1 # x-release-please-version supportedModes: - deployment configSchema: