Skip to content

Dual-publish to npm and GitHub Packages on release#27

Merged
bert-e merged 5 commits into
development/1.0from
improvement/CLDSRVCLT-16/dual-publish-github-packages
Jul 3, 2026
Merged

Dual-publish to npm and GitHub Packages on release#27
bert-e merged 5 commits into
development/1.0from
improvement/CLDSRVCLT-16/dual-publish-github-packages

Conversation

@delthas

@delthas delthas commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Dual-publishes @scality/cloudserverclient to both npmjs and GitHub Packages on release, and attests the published artifact. Mirrors the dual-publish + attestation model of @scality/hdclient and @scality/arsenal (ARSN-605). Today only a stale 1.0.0 sits on GitHub Packages.

How — build once, publish the same tarball to both

  • build — after the branch / version / tag / release guards: yarn buildnpm pack → generate a signed GitHub build-provenance attestation for the tarball (actions/attest-build-provenance) → upload the .tgz as the artifact.
  • publish-npm — download the tarball, npm publish *.tgz --provenance --tag latest via OIDC trusted publishing (no token). npm-native provenance shows on npmjs.
  • publish-github — download the same tarball, npm publish *.tgz --tag latest with the built-in GITHUB_TOKEN.
  • create-release — GitHub release + tag once both publishes succeed, linking both packages.

Building/packing once and publishing the same tarball means a single attestation — gh attestation verify <tgz> --repo scality/cloudserverclient — covers whatever lands in either registry, plus npm-native provenance on npmjs.

Hardening

  • Release only from development/* or hotfix/*.
  • Fail early if the version's git tag or GitHub release already exists.
  • Each publish skips if that version is already on that registry, so a partial dual-publish can be re-run cleanly instead of hitting E409.
  • Least-privilege permissions per job (attestations: write on build, packages: write on publish-github, id-token: write on build/publish-npm).

package.json

  • Removed the publishConfig.registry pin (kept access: public); each job sets its own target registry via setup-node (matches hdclient/arsenal). Scoped name, types, files already present.

Why

Step toward migrating Scality Node consumers (cloudserver, backbeat, s3utils, Zenko) to pull @scality/* from GitHub Packages (ARSN-605). The @scality:registry redirect applies to the whole scope, so every @scality/* dependency must be available on GitHub Packages; cloudserverclient is the main gap.

Notes

  • Version stays committed / manually bumped — no auto-stamp.
  • Provenance: npm-native --provenance is npmjs-only, so the GitHub Packages copy is instead covered by the GitHub build-provenance attestation (both registries get the same attested tarball).
  • Out of scope: migrating consumers; retro-publishing old versions (new releases only, per S3C-9725).

Issue: CLDSRVCLT-16

Add a publish-github job to the release workflow that reuses the build
artifact and publishes @scality/cloudserverclient to GitHub Packages via
GITHUB_TOKEN, in parallel with the existing npm publish. Remove the
publishConfig.registry pin to npmjs so each publish job's setup-node
controls its target registry, and gate the GitHub release on both
publishes succeeding.

Issue: CLDSRVCLT-16
@bert-e

bert-e commented Jul 2, 2026

Copy link
Copy Markdown

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@scality scality deleted a comment from bert-e Jul 2, 2026
@delthas delthas marked this pull request as ready for review July 2, 2026 22:54
@bert-e

bert-e commented Jul 2, 2026

Copy link
Copy Markdown

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@delthas delthas requested review from a team, SylvainSenechal and benzekrimaha July 2, 2026 22:54

@SylvainSenechal SylvainSenechal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure we wanna do this ? Why do we want to release on github too ? For this project we said we wanted to install from npm only 🤔

@delthas

delthas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

are you sure we wanna do this ? Why do we want to release on github too ? For this project we said we wanted to install from npm only 🤔

See the "Why": the end goal is to be able to consume JS packages from package registries rather than from Git (enabling us, later, to drop bump commits entirely). To do this we'll tell JS that all packages from "scality/" are stored in the Github package registry. This is namespace/org-wide redirect, so if we do this eg in cloudserver to pull arsenal from the Github package registry, it will also want to pull cloudserverclient from the Github package registry. Hence the need to dual publish.

Comment thread .github/workflows/release.yml Outdated
Comment thread package.json
Match the npm publish job's explicit dist-tag on the GitHub Packages
job. Behaviorally a no-op (npm publish already defaults to the latest
tag), but keeps the two publish steps symmetric and self-documenting.

Issue: CLDSRVCLT-16
@delthas delthas force-pushed the improvement/CLDSRVCLT-16/dual-publish-github-packages branch from cf97cee to 77e77c7 Compare July 3, 2026 12:50
@delthas delthas requested review from francoisferrand and removed request for francoisferrand July 3, 2026 12:52
Restructure the release workflow to pack a single tarball, generate a
signed GitHub build-provenance attestation for it, and publish that same
tarball to both npmjs and GitHub Packages. A single attestation
(verifiable with `gh attestation verify`) then covers whatever lands in
either registry, in addition to npm-native provenance on npmjs.

Also harden the workflow, mirroring the arsenal release model:
- reject releases from branches other than development/* or hotfix/*
- fail early if the version's git tag or GitHub release already exists
- skip a registry publish when that version is already present there, so
  a partial dual-publish can be re-run cleanly instead of hitting E409
- least-privilege permissions per job (attestations: write on build)

npm publishing keeps OIDC trusted publishing and the latest dist-tag.

Issue: CLDSRVCLT-16
@delthas delthas requested a review from francoisferrand July 3, 2026 14:22
@delthas

delthas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Added Github packages attestation

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
delthas added 2 commits July 3, 2026 18:08
Bump the packed-tarball artifact retention from 1 to 7 days so a publish
that fails late on a Friday can still be retried the following Monday by
re-running the failed job, instead of the artifact having already
expired.

Issue: CLDSRVCLT-16
@delthas

delthas commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Jul 3, 2026

Copy link
Copy Markdown

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/1.0

Please check the status of the associated issue CLDSRVCLT-16.

Goodbye delthas.

The following options are set: approve

@bert-e bert-e merged commit c46c8c5 into development/1.0 Jul 3, 2026
4 checks passed
@bert-e bert-e deleted the improvement/CLDSRVCLT-16/dual-publish-github-packages branch July 3, 2026 16:17
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.

5 participants