@getyoti/trusted-publishing-test 0.0.0 → 0.0.5-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -11
  2. package/package.json +7 -3
package/README.md CHANGED
@@ -4,13 +4,12 @@ Throwaway package used to validate npm trusted publishing at Yoti ([INF-47760](h
4
4
  **Do not depend on it.** It will be deprecated once the test is complete.
5
5
 
6
6
  The workflow in [`.github/workflows/publish.yaml`](.github/workflows/publish.yaml) is the reference for moving a package to trusted publishing.
7
- It is the same as [getyoti/yoti-node-sdk#616](https://github.com/getyoti/yoti-node-sdk/pull/616), with two differences:
7
+ It is the same as [getyoti/yoti-node-sdk#617](https://github.com/getyoti/yoti-node-sdk/pull/617), except that it reads the package name from `package.json`.
8
+ **Merging a version bump to `main` is the release.** The tag and GitHub release are created by the workflow, after npm has accepted the package.
8
9
 
9
- * it reads the package name from `package.json`
10
- * it does not pass `--provenance`, because this repo is **private** and npm rejects provenance from private repos.
11
- Public repos should keep `--provenance`.
12
-
13
- The package itself is public on npmjs; only the source repo is private.
10
+ **Private repos** must drop `--provenance` from the publish step, because npm rejects provenance from private repos.
11
+ Private repos in an organization on GitHub Free also get no environment protection (required reviewers, tag rules),
12
+ so check the organization's plan before relying on the approval gate.
14
13
 
15
14
  ## Setting up a package
16
15
 
@@ -18,7 +17,7 @@ The package itself is public on npmjs; only the source repo is private.
18
17
  An npm org owner publishes the first version interactively with 2FA, without creating a token.
19
18
  2. **GitHub environment.** In the repo, go to Settings → Environments → New environment `npm`:
20
19
  * Required reviewers: the owning team, with **Prevent self-review** ticked
21
- * Deployment branches and tags: tags matching `v*` only
20
+ * Deployment branches and tags: the `main` branch only
22
21
  3. **npmjs trusted publisher.** On npmjs.com, go to the package's Settings → Trusted Publisher → GitHub Actions:
23
22
  * Organization: `getyoti`
24
23
  * Repository: `<repo>`
@@ -28,10 +27,14 @@ The package itself is public on npmjs; only the source repo is private.
28
27
 
29
28
  ## Releasing
30
29
 
31
- 1. Bump the version in a PR (`npm version patch --no-git-tag-version`) and merge it.
32
- 2. Create a GitHub release with tag `v<version>`. Tick **Set as a pre-release** only for versions with a suffix such as `-rc.0`.
33
- 3. Approve the deployment from the workflow run (**Review deployments**).
34
- 4. Check the version on npmjs.com. Public repos show a provenance badge; private repos like this one do not.
30
+ 1. Bump the version in a PR (`npm version patch --no-git-tag-version`, or `prerelease --preid=rc`) and merge it to `main`.
31
+ Don't create a tag or GitHub release yourself.
32
+ 2. Approve the deployment from the workflow run (**Review deployments**).
33
+ 3. The workflow publishes to npm, then creates tag `v<version>` and the GitHub release, with the published tarball attached.
34
+ 4. Check the version on npmjs.com for the provenance badge.
35
+
36
+ If the build fails or the deployment is rejected, nothing is published or tagged.
37
+ Fix it with a new commit, or re-run from **Actions > Publish > Run workflow** on `main`.
35
38
 
36
39
  Stable versions go to the `latest` dist-tag and pre-releases go to `next`.
37
40
  Deprecating, unpublishing and changing dist-tags are not covered by trusted publishing; an npm org owner does them by hand.
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@getyoti/trusted-publishing-test",
3
- "version": "0.0.0",
3
+ "version": "0.0.5-rc.0",
4
4
  "description": "Throwaway package used to validate npm trusted publishing at Yoti (INF-47760). Do not use.",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
- "files": ["index.js"],
8
- "engines": { "node": ">=22" },
7
+ "files": [
8
+ "index.js"
9
+ ],
10
+ "engines": {
11
+ "node": ">=22"
12
+ },
9
13
  "scripts": {
10
14
  "test": "node --test"
11
15
  },