From 995f5737fc5fb0a8261ea9c5df721f9a73856cc8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 7 Feb 2026 22:49:07 +0000 Subject: [PATCH] Add workflow_dispatch workflow to create releases from GitHub UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a "Create Release" workflow that can be triggered manually from the Actions tab. It takes a version string, validates the format, checks for duplicate tags, runs tests, updates manifest.json, commits, tags, and pushes — which then triggers the existing release workflow to build and publish the artifact. https://claude.ai/code/session_0158SxS2ATe6PL8zTpsoHRFn --- .github/workflows/create-release.yml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..487ecff --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,54 @@ +name: Create Release + +on: + workflow_dispatch: + inputs: + version: + description: "Release version (e.g., 1.2.3, without the 'v' prefix)" + required: true + type: string + +permissions: + contents: write + +jobs: + create-release: + name: Create Release Tag + runs-on: ubuntu-latest + steps: + - name: Validate version format + run: | + if [[ ! "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + echo "::error::Invalid version format '${{ inputs.version }}'. Use X.X.X (e.g., 1.2.3)" + exit 1 + fi + + - name: Check tag does not already exist + run: | + if git ls-remote --tags origin "refs/tags/v${{ inputs.version }}" | grep -q .; then + echo "::error::Tag v${{ inputs.version }} already exists" + exit 1 + fi + + - name: Check out code + uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Run tests + run: go test -race ./... + + - name: Update manifest.json version + run: sed -i 's/"version": *"[^"]*"/"version": "${{ inputs.version }}"/' manifest.json + + - name: Commit, tag, and push + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add manifest.json + git commit -m "Release v${{ inputs.version }}" + git tag "v${{ inputs.version }}" + git push origin main "v${{ inputs.version }}"