@getyoti/trusted-publishing-test 0.0.0-stage → 0.0.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 +23 -0
- package/README.md +36 -2
- package/index.js +4 -0
- package/package.json +17 -4
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,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @getyoti/trusted-publishing-test
|
|
2
2
|
|
|
3
|
-
|
|
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#616](https://github.com/getyoti/yoti-node-sdk/pull/616), with two differences:
|
|
8
|
+
|
|
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.
|
|
14
|
+
|
|
15
|
+
## Setting up a package
|
|
16
|
+
|
|
17
|
+
1. **First publish (once, by hand).** npm can only configure a trusted publisher on a package that already exists.
|
|
18
|
+
An npm org owner publishes the first version interactively with 2FA, without creating a token.
|
|
19
|
+
2. **GitHub environment.** In the repo, go to Settings → Environments → New environment `npm`:
|
|
20
|
+
* Required reviewers: the owning team, with **Prevent self-review** ticked
|
|
21
|
+
* Deployment branches and tags: tags matching `v*` only
|
|
22
|
+
3. **npmjs trusted publisher.** On npmjs.com, go to the package's Settings → Trusted Publisher → GitHub Actions:
|
|
23
|
+
* Organization: `getyoti`
|
|
24
|
+
* Repository: `<repo>`
|
|
25
|
+
* Workflow filename: `publish.yaml`
|
|
26
|
+
* Environment: `npm`
|
|
27
|
+
4. **Lock down.** In the same settings page, set Publishing access to **Require two-factor authentication and disallow tokens**.
|
|
28
|
+
|
|
29
|
+
## Releasing
|
|
30
|
+
|
|
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.
|
|
35
|
+
|
|
36
|
+
Stable versions go to the `latest` dist-tag and pre-releases go to `next`.
|
|
37
|
+
Deprecating, unpublishing and changing dist-tags are not covered by trusted publishing; an npm org owner does them by hand.
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getyoti/trusted-publishing-test",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.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": ["index.js"],
|
|
8
|
+
"engines": { "node": ">=22" },
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "node --test"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/getyoti/trusted-publishing-test.git"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
}
|
|
19
|
+
}
|