Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

fix(ci): require tags for release publishing

Samir Hossains3abd88283652
diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml
index f5c59fb..436f5e0 100644
--- a/.github/workflows/homebrew.yml
+++ b/.github/workflows/homebrew.yml
@@ -6,6 +6,10 @@ on:
types:
- completed
workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Release tag to mirror into Homebrew (e.g. v0.1.10)'
+ required: true
jobs:
update-homebrew:
@@ -18,7 +22,7 @@ jobs:
id: ref
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
- REF="${{ github.ref }}"
+ REF="${{ github.event.inputs.tag }}"
else
REF="${{ github.event.workflow_run.head_sha }}"
fi
@@ -35,6 +39,10 @@ jobs:
run: |
VERSION="v$(grep '^version =' Cargo.toml | head -1 | awk -F'"' '{print $2}')"
CLEAN_VERSION="${VERSION#v}"
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "$VERSION" != "${{ github.event.inputs.tag }}" ]; then
+ echo "Cargo.toml version $VERSION does not match requested tag ${{ github.event.inputs.tag }}"
+ exit 1
+ fi
echo "version=$CLEAN_VERSION" >> $GITHUB_OUTPUT
echo "tag=$VERSION" >> $GITHUB_OUTPUT
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 2f75ed0..c10b1f1 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -8,8 +8,8 @@ on:
workflow_dispatch:
inputs:
tag:
- description: 'Tag/version to publish (e.g. v0.1.8)'
- required: false
+ description: 'Release tag to publish (e.g. v0.1.10)'
+ required: true
jobs:
publish:
@@ -20,10 +20,8 @@ jobs:
- name: Determine ref
id: ref
run: |
- if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.tag }}" ]; then
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
REF="${{ github.event.inputs.tag }}"
- elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
- REF="${{ github.ref }}"
else
REF="${{ github.event.workflow_run.head_sha }}"
fi
@@ -37,6 +35,10 @@ jobs:
run: |
VERSION=$(grep '^version =' Cargo.toml | head -1 | awk -F'"' '{print $2}')
echo "Publishing version $VERSION from ${{ steps.ref.outputs.target_ref }}"
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "v$VERSION" != "${{ github.event.inputs.tag }}" ]; then
+ echo "Cargo.toml version v$VERSION does not match requested tag ${{ github.event.inputs.tag }}"
+ exit 1
+ fi
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
diff --git a/docs/release-checklist.md b/docs/release-checklist.md
index 5c4f1e9..f60bcc5 100644
--- a/docs/release-checklist.md
+++ b/docs/release-checklist.md
@@ -24,6 +24,9 @@ Confirm the main GitHub Actions workflows are green:
- `Publish to Crates.io` when applicable
- `Update Homebrew Formula` when applicable
+If you manually dispatch `Publish to Crates.io` or `Update Homebrew Formula`,
+run them against the explicit release tag, not a branch head.
+
## 2. Desktop playback checks
Verify at least one real playback launch on each supported desktop OS: