Skip to content

ci(release): enable npm publish, create GitHub Releases on tag, add gated Homebrew bump job - #98

Merged
sjsyrek merged 1 commit into
mainfrom
ci/release-automation
Jul 28, 2026
Merged

ci(release): enable npm publish, create GitHub Releases on tag, add gated Homebrew bump job#98
sjsyrek merged 1 commit into
mainfrom
ci/release-automation

Conversation

@sjsyrek

@sjsyrek sjsyrek commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Turns the tag-triggered release pipeline on (sync-8mqh.5). The npm publish job has been hard-disabled (if: false) since its introduction — which is also why the repo has 17 annotated tags and zero GitHub Releases. After this PR, pushing a v* tag publishes to npm with provenance AND creates a GitHub Release, as two independent jobs.

Changes Made

  • publish job — removed if: false. Authenticates via a granular NPM_TOKEN secret scoped to @deepl/cli (required for the FIRST publish; npm's OIDC trusted-publishing config lives in package settings, so the package must exist before OIDC can be configured — switch and revoke the token afterwards). --provenance retained; the job already grants id-token: write.
  • release job (new) — creates a GitHub Release from the pushed tag (gh release create --verify-tag), with notes extracted from that version's CHANGELOG section via awk; if the section is missing it falls back to --generate-notes. Runs with contents: write, independent of publish by design: a publish failure cannot suppress the Release and vice versa. Compatible with release immutability (assets/tag freeze at publish; notes stay editable).
  • homebrew job (new, gated if: false) — downloads the published registry tarball, computes its sha256, and opens a version-bump PR against DeepL/homebrew-tap. Gated until the tap repo and a cross-repo HOMEBREW_TAP_TOKEN fine-grained PAT exist (the default github.token cannot push cross-repo); the gate and enable instructions are documented in the workflow comment.
  • Workflow renamed Publish to npmRelease to reflect its wider role.
  • Uses only actions/checkout/actions/setup-node (already allowlisted) plus the runner's gh CLI — no new third-party actions, which matters since repo Actions permissions are set to "selected".

Test Coverage

Workflow logic is not unit-testable from jest, so the fragile pieces were verified directly:

  • YAML parses cleanly.
  • The awk changelog extraction was run against the real CHANGELOG.md: a present version (1.2.0) yields exactly its section; an absent version yields empty output, triggering the --generate-notes fallback.
  • End-to-end verification happens at the v2.0.0 tag push (sync-w79t), which is the next issue in the sequence and the first real firing of this pipeline.

Backward Compatibility

✅ No runtime/user-facing behavior changes — CI-only.
⚠️ Operational prerequisite: the NPM_TOKEN repo secret must exist before the v2.0.0 tag is pushed, or the publish job fails (the Release job still runs, by design).

Size: Small ✓

One workflow file; the risk is operational (first firing at tag time), mitigated by job independence and the gated Homebrew job.

🤖 Generated with Claude Code

…ated Homebrew bump job

Remove the if: false that has disabled the publish job since its
introduction (the reason the repo has 17 tags and zero GitHub Releases).
Publishing authenticates with a granular NPM_TOKEN scoped to @deepl/cli
for the first publish, keeping --provenance; the switch to OIDC trusted
publishing happens after the package exists on npmjs.com.

Add an independent release job that creates a GitHub Release from the
pushed tag with notes extracted from that version's CHANGELOG section
(verified against the real CHANGELOG; missing sections fall back to
--generate-notes). The jobs are deliberately not chained so a failure
in one cannot suppress the other.

Add a homebrew formula-bump job (tarball sha256 + version PR against
DeepL/homebrew-tap) gated with if: false until the tap repo and its
cross-repo HOMEBREW_TAP_TOKEN exist.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sjsyrek
sjsyrek merged commit 1f1ed9d into main Jul 28, 2026
5 checks passed
@sjsyrek
sjsyrek deleted the ci/release-automation branch July 28, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant