Imported from tacogips/kinko (
.agents/skills/release-workflow/SKILL.md). Install upstream withnpx skills add tacogips/kinko --skill release-workflow. Copyright stays with the author.
Release Workflow Skill (Go)
This skill standardizes release execution for kinko using the repository mise.toml and version source internal/build/VERSION.
When to Apply
Apply this skill when the user asks to:
- release a merged version
- publish artifacts
- create a GitHub release
- build distributable binaries
Release Contract
In this repository, interpret an unscoped "release" request as:
- Build and verify local cross-platform binaries
- Create versioned release artifacts and checksums
- Commit release artifacts if requested by the user
- Push branch and tags to GitHub
- Publish GitHub Release only if the user explicitly asks for remote publishing
- Update, commit, push, and verify the Homebrew tap formula after a GitHub Release is published
If the user explicitly asks for "binary only", perform steps 1-2 only.
Preconditions
- Ensure branch is clean and up to date.
- Ensure
internal/build/VERSIONis the intended release version. - Ensure Go toolchain is available (
go version). - Ensure mise is available and the project configuration is trusted (
mise --version,mise trust). - Ensure GitHub CLI auth is valid for remote publishing:
gh auth status
- Ensure remote is configured and writable:
git remote -vgit push --dry-run origin <branch>
- Ensure the Homebrew tap checkout is available when updating the formula:
- default path:
../homebrew-tap - formula path:
Formula/kinko.rb
- default path:
Standard Commands
Local Cross-Platform Binary Release (default)
set -euo pipefail
VERSION="$(cat internal/build/VERSION)"
ARTIFACT_DIR="dist/release"
mkdir -p "${ARTIFACT_DIR}"
mise run clean
mise run build
mise run smoke
for target in \
"linux amd64 tar.gz" \
"linux arm64 tar.gz" \
"darwin amd64 tar.gz" \
"darwin arm64 tar.gz" \
"windows amd64 zip" \
"windows arm64 zip"
do
set -- $target
GOOS="$1"
GOARCH="$2"
PKG="$3"
EXT=""
if [ "$GOOS" = "windows" ]; then
EXT=".exe"
fi
BIN="kinko_${VERSION}_${GOOS}_${GOARCH}${EXT}"
OUT_BASE="kinko_${VERSION}_${GOOS}_${GOARCH}"
GOOS="$GOOS" GOARCH="$GOARCH" CGO_ENABLED=0 \
go build -ldflags "-s -w -X github.com/tacogips/kinko/internal/build.version=${VERSION}" \
-o "${ARTIFACT_DIR}/${BIN}" ./cmd/kinko
if [ "$PKG" = "zip" ]; then
(cd "${ARTIFACT_DIR}" && zip -q "${OUT_BASE}.zip" "${BIN}")
rm -f "${ARTIFACT_DIR:?}/${BIN}"
else
(cd "${ARTIFACT_DIR}" && tar -czf "${OUT_BASE}.tar.gz" "${BIN}")
rm -f "${ARTIFACT_DIR:?}/${BIN}"
fi
done
(cd "${ARTIFACT_DIR}" && find . -maxdepth 1 -type f \( -name 'kinko_*.tar.gz' -o -name 'kinko_*.zip' \) -exec basename {} \; | sort | xargs shasum -a 256 > SHA256SUMS)
SHA256SUMS is directory-wide. If older kinko_* archives remain in dist/release/, do not overwrite the manifest with latest-version-only entries; include every retained archive so historical and current release artifacts can be verified together.
Commit and Push (when user requests push)
set -euo pipefail
VERSION="$(cat internal/build/VERSION)"
BRANCH="$(git branch --show-current)"
TAG="v${VERSION}"
git add dist/release
git status --short
git commit -m "release: build artifacts for ${TAG}"
# Push branch updates first
git push origin "${BRANCH}"
# Create and push tag
git tag "${TAG}"
git push origin "${TAG}"
Use signed tags when available:
git tag -s "v${VERSION}" -m "Release v${VERSION}"
git push origin "v${VERSION}"
Optional GitHub Release Publish (after push/tag)
Run only when explicitly requested:
VERSION="$(cat internal/build/VERSION)"
TAG="v${VERSION}"
gh release create "${TAG}" \
dist/release/kinko_${VERSION}_linux_amd64.tar.gz \
dist/release/kinko_${VERSION}_linux_arm64.tar.gz \
dist/release/kinko_${VERSION}_darwin_amd64.tar.gz \
dist/release/kinko_${VERSION}_darwin_arm64.tar.gz \
dist/release/kinko_${VERSION}_windows_amd64.zip \
dist/release/kinko_${VERSION}_windows_arm64.zip \
"dist/release/SHA256SUMS" \
--title "${TAG}" \
--notes "Release ${TAG}"
If release exists, use gh release upload with --clobber.
Homebrew Formula Update (after GitHub Release publish)
The Homebrew formula lives in tacogips/homebrew-tap as Formula/kinko.rb.
Update it only after the GitHub Release assets exist and their SHA256 values are known. Homebrew installs the latest published GitHub Release, not unreleased main; do not point the formula at a tag until gh release view v<VERSION> succeeds.
Expected formula artifact mapping:
| Homebrew platform | Release asset |
|---|---|
| macOS Apple Silicon | kinko_${VERSION}_darwin_arm64.tar.gz |
| macOS Intel | kinko_${VERSION}_darwin_amd64.tar.gz |
| Linux ARM64 | kinko_${VERSION}_linux_arm64.tar.gz |
| Linux x86_64 | kinko_${VERSION}_linux_amd64.tar.gz |
Use the GitHub Release asset digests or shasum -a 256 on downloaded assets to update the formula:
VERSION="$(cat internal/build/VERSION)"
TAP_DIR="${TAP_DIR:-../homebrew-tap}"
gh release view "v${VERSION}" \
--repo tacogips/kinko \
--json assets \
--jq '.assets[] | select(.name | test("kinko_.*_(darwin|linux)_(amd64|arm64)\\.tar\\.gz$")) | [.name, .digest] | @tsv'
# Edit "${TAP_DIR}/Formula/kinko.rb":
# - version "${VERSION}"
# - URL paths under https://github.com/tacogips/kinko/releases/download/v${VERSION}/
# - sha256 values without the "sha256:" prefix
Then verify the formula from the tap checkout:
cd "${TAP_DIR}"
ruby -c Formula/kinko.rb
brew update
brew audit --strict --online kinko || brew audit --strict kinko
brew install kinko
kinko version
brew test kinko
Commit and push the tap update after local verification:
cd "${TAP_DIR}"
git add Formula/kinko.rb README.md
git diff --staged --stat
git commit -m "chore: release kinko ${VERSION}"
git push origin main
brew update
brew reinstall tacogips/tap/kinko
kinko version
brew test tacogips/tap/kinko
If brew audit --online fails due network or GitHub rate limits, run the non-online audit and record the limitation. Homebrew rejects arbitrary formula paths that are not in a registered tap, so verify through the tacogips/tap/kinko formula name after the tap update is committed and pushed.
Verification Checklist
After release commands finish:
./kinko versionmatchesinternal/build/VERSION.dist/release/kinko_<version>_<os>_<arch>.(tar.gz|zip)exists for all target platforms.dist/release/SHA256SUMSexists and validates:cd dist/release && shasum -a 256 -c SHA256SUMS
dist/release/SHA256SUMShas one entry for every retained release archive:git ls-files dist/release | awk -F/ '/kinko_/ {print $NF}' | sort > /tmp/kinko-release-files.txtawk '{print $2}' dist/release/SHA256SUMS | sort > /tmp/kinko-release-sums.txtdiff -u /tmp/kinko-release-files.txt /tmp/kinko-release-sums.txt
- If push was requested, branch and
v<version>tag are visible on origin. - Working tree has no unintended generated files beyond release artifacts.
- If GitHub publish was requested, confirm release URL exists for
v<version>. - If GitHub publish was requested,
tacogips/homebrew-taphasFormula/kinko.rbupdated to the same version, committed, pushed tomain, and install-tested throughtacogips/tap/kinko.
Failure Handling
- If
mise run buildfails, runmise exec -- go build ./...to isolate compile errors. - If
mise run smokefails, stop and report failing test/build command output. - If version mismatch appears in
kinko version, verify linker flag wiring inmise.toml. - If
gh release createfails due to existing tag/release, use:gh release upload <tag> <files...> --clobber
- If checksum validation or archive coverage fails, rebuild artifacts as needed and regenerate
SHA256SUMSfor every retaineddist/release/kinko_*archive. - If tag already exists, verify target commit and use
gh release uploadwithout recreating tag. - If
zipis unavailable, generate Windows.zipwith a temporary Go helper usingarchive/zip. - If Homebrew cannot install the formula, inspect the archive layout with
tar -tzf; current archives contain one platform-named binary, and the formula should install it askinko.