@getyoti/trusted-publishing-test 0.0.0-stage → 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.
package/LICENSE.md ADDED
@@ -0,0 +1,23 @@
1
+ # MIT License
2
+
3
+ Copyright © 2017 Yoti Ltd
4
+
5
+ * * *
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,40 @@
1
- # Temporary Holding Version
1
+ # @getyoti/trusted-publishing-test
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Throwaway package used to validate npm trusted publishing at Yoti ([INF-47760](https://lampkicking.atlassian.net/browse/INF-47760)).
4
+ **Do not depend on it.** It will be deprecated once the test is complete.
5
+
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#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.
9
+
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.
13
+
14
+ ## Setting up a package
15
+
16
+ 1. **First publish (once, by hand).** npm can only configure a trusted publisher on a package that already exists.
17
+ An npm org owner publishes the first version interactively with 2FA, without creating a token.
18
+ 2. **GitHub environment.** In the repo, go to Settings → Environments → New environment `npm`:
19
+ * Required reviewers: the owning team, with **Prevent self-review** ticked
20
+ * Deployment branches and tags: the `main` branch only
21
+ 3. **npmjs trusted publisher.** On npmjs.com, go to the package's Settings → Trusted Publisher → GitHub Actions:
22
+ * Organization: `getyoti`
23
+ * Repository: `<repo>`
24
+ * Workflow filename: `publish.yaml`
25
+ * Environment: `npm`
26
+ 4. **Lock down.** In the same settings page, set Publishing access to **Require two-factor authentication and disallow tokens**.
27
+
28
+ ## Releasing
29
+
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`.
38
+
39
+ Stable versions go to the `latest` dist-tag and pre-releases go to `next`.
40
+ Deprecating, unpublishing and changing dist-tags are not covered by trusted publishing; an npm org owner does them by hand.
package/index.js ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ // Throwaway package for validating npm trusted publishing (INF-47760). Do not depend on it.
4
+ module.exports = { version: require('./package.json').version };
package/package.json CHANGED
@@ -1,6 +1,23 @@
1
1
  {
2
2
  "name": "@getyoti/trusted-publishing-test",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.5-rc.0",
4
+ "description": "Throwaway package used to validate npm trusted publishing at Yoti (INF-47760). Do not use.",
5
+ "license": "MIT",
6
+ "main": "index.js",
7
+ "files": [
8
+ "index.js"
9
+ ],
10
+ "engines": {
11
+ "node": ">=22"
12
+ },
13
+ "scripts": {
14
+ "test": "node --test"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/getyoti/trusted-publishing-test.git"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }