feat(commands): register generated Goose recipes as slash commands #919
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Assets | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag (e.g., v7.6.2)" | |
| required: true | |
| type: string | |
| permissions: | |
| artifact-metadata: write # Required for recording attested artifacts | |
| attestations: write # Required for publishing build provenance | |
| id-token: write # Required for signing build provenance with Sigstore | |
| contents: write # Required for uploading release assets | |
| jobs: | |
| build-assets: | |
| name: Build and upload assets | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'workflow_dispatch' || | |
| ( | |
| github.event.pull_request.merged == true && | |
| startsWith(github.event.pull_request.head.ref, 'release/v') | |
| ) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| # Pin to the merged commit SHA to avoid tagging a later commit if | |
| # main advances between the PR merge and this workflow run. | |
| # Falls back to main for workflow_dispatch runs. | |
| ref: ${{ github.event.pull_request.merge_commit_sha || 'main' }} | |
| # Fetch tags so the existence check below can see remote tags. | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Configure git | |
| uses: ./.github/actions/git-config | |
| - name: Setup mise | |
| uses: jdx/mise-action@7e36c90d9ab29c415a2384db3006f3ec8a8cc654 # v4.2.4 | |
| with: | |
| experimental: true | |
| - name: Install dependencies | |
| # Bun is not supported by the setup action. The tracked .npmrc still | |
| # routes this installation through Takumi Guard. | |
| run: bun install | |
| - name: Build binaries | |
| run: | | |
| mkdir -p dist-bun | |
| bun build --compile --minify --sourcemap --target=bun-linux-x64 --outfile=dist-bun/rulesync-linux-x64 ./src/cli/index.ts | |
| bun build --compile --minify --sourcemap --target=bun-linux-arm64 --outfile=dist-bun/rulesync-linux-arm64 ./src/cli/index.ts | |
| bun build --compile --minify --sourcemap --target=bun-darwin-arm64 --outfile=dist-bun/rulesync-darwin-arm64 ./src/cli/index.ts | |
| bun build --compile --minify --sourcemap --target=bun-darwin-x64 --outfile=dist-bun/rulesync-darwin-x64 ./src/cli/index.ts | |
| bun build --compile --minify --sourcemap --target=bun-windows-x64 --outfile=dist-bun/rulesync-windows-x64.exe ./src/cli/index.ts | |
| - name: Generate checksums | |
| run: | | |
| cd dist-bun | |
| sha256sum rulesync-* > SHA256SUMS | |
| cat SHA256SUMS | |
| - name: Attest binary build provenance | |
| uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 | |
| with: | |
| subject-checksums: dist-bun/SHA256SUMS | |
| - name: Generate JSON Schemas | |
| run: pnpm generate:schema | |
| - name: Generate repomix XML variants | |
| run: bun scripts/generate-repomix-xml.ts | |
| - name: Bundle XML files into zip | |
| run: zip repomix-xml.zip repomix-output-*.xml | |
| - name: Determine tag name | |
| id: tag | |
| run: | | |
| if [ -n "$TAG_INPUT" ]; then | |
| TAG="$TAG_INPUT" | |
| elif [ "$EVENT_NAME" = "pull_request" ]; then | |
| TAG="${HEAD_REF#release/}" | |
| fi | |
| if [ -z "$TAG" ]; then | |
| echo "::error::Could not determine tag name" | |
| exit 1 | |
| fi | |
| if ! echo "$TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| echo "::error::Invalid tag format: $TAG" | |
| exit 1 | |
| fi | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| env: | |
| TAG_INPUT: ${{ inputs.tag }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| HEAD_REF: ${{ github.event.pull_request.head.ref }} | |
| - name: Create and push tag | |
| run: | | |
| CURRENT_SHA="$(git rev-parse HEAD)" | |
| LOCAL_TAG_EXISTS=0 | |
| if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then | |
| LOCAL_TAG_EXISTS=1 | |
| TAG_SHA="$(git rev-list -n 1 "$TAG")" | |
| if [ "$TAG_SHA" != "$CURRENT_SHA" ]; then | |
| echo "::error::Tag $TAG already exists locally but points to $TAG_SHA instead of $CURRENT_SHA" | |
| exit 1 | |
| fi | |
| fi | |
| # Query both peeled (annotated) and plain (lightweight) refs, preferring | |
| # the peeled form when present so annotated tags resolve to their commit. | |
| REMOTE_SHA="$(git ls-remote --tags origin "refs/tags/$TAG^{}" "refs/tags/$TAG" \ | |
| | awk '$2 ~ /\^\{\}$/ {peeled=$1} $2 !~ /\^\{\}$/ {plain=$1} END {print (peeled ? peeled : plain)}')" | |
| if [ -n "$REMOTE_SHA" ]; then | |
| if [ "$REMOTE_SHA" != "$CURRENT_SHA" ]; then | |
| echo "::error::Tag $TAG already exists on origin but points to $REMOTE_SHA instead of $CURRENT_SHA" | |
| exit 1 | |
| fi | |
| echo "Tag $TAG already exists on origin and points to the current commit, skipping creation" | |
| exit 0 | |
| fi | |
| if [ "$LOCAL_TAG_EXISTS" -eq 1 ]; then | |
| echo "Tag $TAG already exists locally and points to the current commit, pushing to origin" | |
| git push origin "$TAG" | |
| echo "Tag $TAG pushed" | |
| exit 0 | |
| fi | |
| git tag "$TAG" | |
| git push origin "$TAG" | |
| echo "Tag $TAG created and pushed" | |
| env: | |
| TAG: ${{ steps.tag.outputs.tag }} | |
| - name: Upload assets to release | |
| uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| draft: true | |
| files: | | |
| install.sh | |
| dist-bun/rulesync-linux-x64 | |
| dist-bun/rulesync-linux-arm64 | |
| dist-bun/rulesync-darwin-arm64 | |
| dist-bun/rulesync-darwin-x64 | |
| dist-bun/rulesync-windows-x64.exe | |
| dist-bun/SHA256SUMS | |
| repomix-xml.zip | |
| config-schema.json | |
| permissions-schema.json | |
| mcp-schema.json |