Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:
- name: Test
run: go test ./...

# The annotated tag carries the release text: the subject line becomes the
# release name, everything after the first blank line becomes the body.
# The body is passed through verbatim - its blank lines separate the
# The release is named after the tag and nothing else. The whole annotated
# tag message becomes the body, verbatim - its blank lines separate the
# sections and collapsing them would run the whole thing into one block.
- name: Read the tag
id: tag
Expand All @@ -50,14 +49,9 @@ jobs:
# objecttype is the only reliable test. A lightweight tag is a bare
# ref onto the commit, so %(contents) silently resolves to the COMMIT
# message - trailers and all - instead of returning nothing.
SUBJECT=""
BODY=""
if [ "$(git tag -l --format='%(objecttype)' "$TAG")" = tag ]; then
SUBJECT=$(git tag -l --format='%(contents:subject)' "$TAG")
BODY=$(git tag -l --format='%(contents:body)' "$TAG")
fi
if [ -z "$SUBJECT" ]; then
SUBJECT="SemiBase $TAG"
BODY=$(git tag -l --format='%(contents)' "$TAG")
fi
if [ -z "$(printf '%s' "$BODY" | tr -d '[:space:]')" ]; then
BODY="Release $TAG"
Expand All @@ -68,7 +62,6 @@ jobs:
# lines to be read as further outputs, overriding the ones above.
# printf, not echo, so a body opening with -n or -e stays intact.
DELIMITER="RELEASE_NOTES_$(openssl rand -hex 16)"
echo "name=$SUBJECT" >> "$GITHUB_OUTPUT"
{
echo "body<<$DELIMITER"
printf '%s\n' "$BODY"
Expand All @@ -93,10 +86,10 @@ jobs:
-ldflags "-s -w -X main.revision=$TAG" \
-o "dist/semibase_${VERSION}_${goos}_${goarch}${extension}" ./cmd/semibase
}
# no extension on linux - an ELF is executable by its mode bit
build windows amd64 .exe
build linux amd64 ""
cd dist && sha256sum * > checksums.txt
cat checksums.txt
ls -l dist

# Pinned to a commit, not a tag: this is the one third-party action that
# runs with the job's contents: write token, so a moved tag in its
Expand All @@ -105,7 +98,7 @@ jobs:
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: ${{ steps.tag.outputs.name }}
name: ${{ steps.tag.outputs.tag }}
body: ${{ steps.tag.outputs.body }}
draft: false
prerelease: false
Expand Down
15 changes: 6 additions & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ Without ldflags, `version` falls back to the VCS revision recorded by the Go too
`.github/workflows/release.yml` fires on a `v*` tag push. One `ubuntu-latest` job
cross-compiles `windows/amd64` and `linux/amd64` with `CGO_ENABLED=0` — the module is pure
`pgx`, so native runners are CI's job, not the release's — and attaches
`semibase_<version>_<goos>_amd64[.exe]` plus a sha256 `checksums.txt` to the GitHub release.
`-X main.revision=<tag>` is embedded, so `semibase version` prints the tag.
`semibase_<version>_<goos>_amd64[.exe]` to the GitHub release — no extension on the Linux
artifact, an ELF is executable by its mode bit. `-X main.revision=<tag>` is embedded, so
`semibase version` prints the tag.

The annotated tag carries the release text: its subject line becomes the release name,
everything after the first blank line becomes the body, verbatim. Blank lines survive, so
write the body in sections.
The release is named after the tag and nothing else. The whole annotated tag message becomes
the body, verbatim; blank lines survive, so write it in sections and give it no title line.

```bash
git tag -a v0.2.0 -F - <<'EOF'
v0.2.0 — short title

**New Features**

* what the user can now do, lowercase [#12](https://github.com/Semiteq/SemiBase/pull/12)
Expand All @@ -48,8 +46,7 @@ git push origin v0.2.0

Bold section labels, not `###` headings: git's default tag cleanup deletes every line
starting with `#`, which would silently strip the structure out of the annotation.
A lightweight tag still releases — the name falls back to `SemiBase <tag>`, the body to
`Release <tag>`.
A lightweight tag still releases — the body falls back to `Release <tag>`.

## Test

Expand Down