From e01f38ab399a73b2ad2516a68bb9d1fa07f8d230 Mon Sep 17 00:00:00 2001 From: Hein Date: Wed, 23 Sep 2026 22:21:22 +0200 Subject: [PATCH] RELEASING: Releasing 1 package(s) Releases: @warkypublic/artemis-kit@1.1.1 [skip ci] --- AGENTS.md | 16 ++++++++++++++ CHANGELOG.md | 10 +++++++++ Makefile | 5 +++++ package.json | 2 +- scripts/release.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100755 scripts/release.sh diff --git a/AGENTS.md b/AGENTS.md index 0a12809..b85df73 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,6 +42,22 @@ repository's user or organization (not necessarily the npm scope `warkypublic`). pnpm, which applies the `publishConfig` entries for built JavaScript and declarations. +## Cutting a release with `make release` + +`make release [BUMP=patch|minor|major]` (default `patch`) runs +`scripts/release.sh`, which: + +1. Finds commits since the last changeset file (`.changeset/*.md`) and writes + a new changeset from their subject lines, bumping `@warkypublic/artemis-kit` + by `BUMP`. +2. Runs `pnpm changeset version` to consume the changeset and bump the + package version/changelog. +3. Commits the result, tags it `v`, and pushes the commit and + tag to `origin` (GitHub) — this triggers `.github/workflows/publish_github.yml`. + +It exits without changes if there are no commits since the last changeset, or +if the resulting tag already exists. + Stable versions receive the `latest` dist-tag; prereleases receive `next`. Existing package versions cannot be overwritten; release a new version instead. This workflow adds Gitea as a publishing destination without changing the default diff --git a/CHANGELOG.md b/CHANGELOG.md index f870d41..bb60160 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # @warkypublic/artemis-kit +## 1.1.1 + +### Patch Changes + +- - ci(publish): update checkout ref logic for release tags + - ci(publish): update workflow to include release tag verification + - ci(publish): add GitHub Actions workflow for package publishing + - ci(publish): update workflow to require release_tag input + - docs(publish): update publishing instructions for manual dispatch + ## 1.1.0 ### Minor Changes diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1c5ee70 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +.PHONY: release + +# Usage: make release [BUMP=patch|minor|major] +release: + @BUMP=$(BUMP) ./scripts/release.sh diff --git a/package.json b/package.json index 73ad098..d87341d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@warkypublic/artemis-kit", - "version": "1.1.0", + "version": "1.1.1", "description": "A comprehensive TypeScript/JavaScript utility library focused on precision and efficiency.", "type": "module", "main": "./src/index.ts", diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..a1489dc --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Creates a changeset from commits since the last one, versions the +# package, tags the result, and pushes the tag to the git remote. +set -euo pipefail + +BUMP="${BUMP:-patch}" +case "$BUMP" in + patch|minor|major) ;; + *) echo "BUMP must be patch, minor, or major (got: $BUMP)" >&2; exit 1 ;; +esac + +PACKAGE_NAME=$(node -p "require('./package.json').name") + +LAST_CHANGESET_COMMIT=$(git log -1 --format=%H -- '.changeset/*.md' || true) +if [ -n "$LAST_CHANGESET_COMMIT" ]; then + RANGE="${LAST_CHANGESET_COMMIT}..HEAD" +else + RANGE="HEAD" +fi + +COMMITS=$(git log --format='- %s' "$RANGE" -- . ':!.changeset') +if [ -z "$COMMITS" ]; then + echo "No commits found since the last changeset ($RANGE); nothing to release." >&2 + exit 1 +fi + +CHANGESET_FILE=".changeset/release-$(date +%Y%m%d%H%M%S).md" +{ + echo "---" + echo "\"$PACKAGE_NAME\": $BUMP" + echo "---" + echo + echo "$COMMITS" +} > "$CHANGESET_FILE" + +echo "Created $CHANGESET_FILE:" +cat "$CHANGESET_FILE" + +pnpm changeset version + +NEW_VERSION=$(node -p "require('./package.json').version") +TAG="v${NEW_VERSION}" + +if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag $TAG already exists" >&2 + exit 1 +fi + +git add -A +git commit -m "RELEASING: Releasing 1 package(s)" +git tag "$TAG" +git push origin HEAD "$TAG" + +echo "Released and pushed $TAG"