Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/publish-claude-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# publish-claude-plugin syncs the generated marketplace bundle from
# this repo to gortexhq/claude-plugin on every gortex release.
#
# release.yml dispatches it after each release: releases are created
# with GITHUB_TOKEN, which does not fire the `release: published`
# trigger below. That trigger only covers releases published without
# GITHUB_TOKEN, such as by hand.
#
# How it works:
# 1. Checkout gortex at the released tag
# 2. Regenerate the bundle via `make claude-plugin`
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,22 @@ jobs:
./dist/*.rpm
./dist/*.apk
update_release_body: true

# Releases are created with GITHUB_TOKEN, and events from GITHUB_TOKEN
# do not start other workflows, so publish-claude-plugin's
# `release: published` trigger never fires for them. workflow_dispatch
# is the documented exception, so start it explicitly once the
# release exists.
publish-claude-plugin:
needs: release
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Dispatch publish-claude-plugin
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run publish-claude-plugin.yml \
--repo "$GITHUB_REPOSITORY" \
-f ref="$GITHUB_REF_NAME"
21 changes: 20 additions & 1 deletion scripts/validate-cask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,32 @@ rendered="$("$repo_root/scripts/render-cask.sh" 0.0.0 \
# untouched, and the trap removes it even when brew fails.
tap_user="gortexcaskcheck"
tap_dir="$(brew --repository)/Library/Taps/$tap_user/homebrew-tap"
cleanup() { rm -rf "$(brew --repository)/Library/Taps/$tap_user"; }
trust_home=""
cleanup() {
rm -rf "$(brew --repository)/Library/Taps/$tap_user"
if [ -n "$trust_home" ]; then rm -rf "$trust_home"; fi
}
trap cleanup EXIT

cleanup
mkdir -p "$tap_dir/Casks"
printf '%s\n' "$rendered" >"$tap_dir/Casks/gortex.rb"

# Current Homebrew refuses to load casks from a tap nobody has trusted, and
# `brew info` does not trust it on the way like `brew install user/tap/x`
# does. Trust the scratch tap in a throwaway trust store (brew keeps it under
# $XDG_CONFIG_HOME/homebrew when that is set), so the developer's own trust
# store and brew.env are neither read nor changed. HOMEBREW_NO_REQUIRE_TAP_TRUST
# is deprecated, and its warning would trip the check below, so it is unset
# too in case a developer exported it to get past this same error. Older brew
# has no `trust` command and needs none.
trust_home="$(mktemp -d)"
export XDG_CONFIG_HOME="$trust_home"
unset HOMEBREW_NO_REQUIRE_TAP_TRUST HOMEBREW_REQUIRE_TAP_TRUST
if brew trust --help >/dev/null 2>&1; then
brew trust --tap "$tap_user/tap"
fi

echo "==> loading the rendered cask through brew"
# `brew info --cask` evaluates every stanza, so an unknown one (the #639 bug)
# fails here. Output is kept: a reviewer should see the artifact list change
Expand Down
Loading