Skip to content

refactor: improve programmatic API code quality #190

refactor: improve programmatic API code quality

refactor: improve programmatic API code quality #190

Workflow file for this run

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:
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:
ref: main
- name: Setup mise
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v2
with:
experimental: true
- name: Install dependencies
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: Generate JSON Schemas
run: pnpm generate:schema
- name: Generate repomix TOON variants
run: bun scripts/generate-repomix-toon.ts
- name: Bundle TOON files into zip
run: zip repomix-toon.zip repomix-output-*.toon
- name: Determine tag name
id: tag
run: |
if [ -n "$TAG_INPUT" ]; then
echo "tag=$TAG_INPUT" >> "$GITHUB_OUTPUT"
elif [ "$EVENT_NAME" = "pull_request" ]; then
TAG="${HEAD_REF#release/}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
fi
env:
TAG_INPUT: ${{ inputs.tag }}
EVENT_NAME: ${{ github.event_name }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
- name: Upload assets to release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
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-toon.zip
config-schema.json
mcp-schema.json