Skip to content

Commit 51409c3

Browse files
authored
chore: setup npm trusted publishing (#104)
1 parent 731aa9b commit 51409c3

3 files changed

Lines changed: 48 additions & 47 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
permissions:
12+
id-token: write
1213
contents: write
1314
packages: write
1415

@@ -35,5 +36,3 @@ jobs:
3536
3637
- name: Publish
3738
run: npm publish --access public
38-
env:
39-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

README.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,3 @@ React Native bridge for the Transact SDK
44

55
See our [documentation](https://docs.atomicfi.com/reference/transact-sdk#libraries__react-native) for additional information.
66

7-
## Release Instructions
8-
9-
This repository uses automated publishing via GitHub releases. When you publish a release, it automatically:
10-
11-
1. ✅ Updates `package.json` version to match the release tag
12-
2. ✅ Commits the version change back to the repository
13-
3. ✅ Publishes the package to npm with the correct version
14-
15-
### Creating a Release
16-
17-
1. **Ensure your code is ready for release** on the `master` branch
18-
19-
2. **Create a new release** on GitHub:
20-
- Go to [Releases](../../releases) → "Create a new release"
21-
- Use the [release template](RELEASE_TEMPLATE.md) for the release notes
22-
23-
3. **Publish the release** - This automatically triggers the publish workflow
24-
25-
### Version Guidelines
26-
27-
- Use [semantic versioning](https://semver.org/): `MAJOR.MINOR.PATCH`
28-
- Tag format: `1.2.3`
29-
- For testing: Use pre-release tags like `1.2.3-beta.1`
30-
31-
### What Happens Automatically
32-
33-
When you publish a release:
34-
35-
```
36-
GitHub Release (1.2.3) → Workflow Triggers → Updates package.json → Commits Changes → Publishes to npm
37-
```
38-
39-
### Manual Publishing (Fallback)
40-
41-
If needed, you can manually trigger the publish workflow:
42-
43-
1. Go to [Actions](../../actions) → "publish" workflow
44-
2. Click "Run workflow" → Select branch → "Run workflow"
45-
3. Note: Manual triggers skip version updates
46-
47-
### Troubleshooting
48-
49-
- **Workflow fails**: Check the [Actions](../../actions) tab for detailed logs
50-
- **Version conflicts**: Ensure the release tag doesn't already exist on npm
51-
- **Permission issues**: Verify npm token is properly configured in repository secrets

docs/RELEASE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Release Instructions
2+
3+
This repository uses automated publishing via GitHub releases with [npm trusted publishing](https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions) (OIDC-based authentication). No npm tokens or secrets are required — GitHub Actions authenticates directly with npm using OpenID Connect.
4+
5+
When you publish a release, it automatically:
6+
7+
1. Updates `package.json` version to match the release tag
8+
2. Commits the version change back to the repository
9+
3. Publishes the package to npm with provenance via trusted publishing
10+
11+
## Creating a Release
12+
13+
1. **Ensure your code is ready for release** on the `master` branch
14+
15+
2. **Create a new release** on GitHub:
16+
- Go to [Releases](../../releases) → "Create a new release"
17+
- Use the [release template](../RELEASE_TEMPLATE.md) for the release notes
18+
19+
3. **Publish the release** - This automatically triggers the publish workflow
20+
21+
## Version Guidelines
22+
23+
- Use [semantic versioning](https://semver.org/): `MAJOR.MINOR.PATCH`
24+
- Tag format: `1.2.3`
25+
- For testing: Use pre-release tags like `1.2.3-beta.1`
26+
27+
## What Happens Automatically
28+
29+
When you publish a release:
30+
31+
```
32+
GitHub Release (1.2.3) → Workflow Triggers → Updates package.json → Commits Changes → Publishes to npm (via trusted publishing)
33+
```
34+
35+
## Manual Publishing (Fallback)
36+
37+
If needed, you can manually trigger the publish workflow:
38+
39+
1. Go to [Actions](../../actions) → "publish" workflow
40+
2. Click "Run workflow" → Select branch → "Run workflow"
41+
3. Note: Manual triggers skip version updates
42+
43+
## Troubleshooting
44+
45+
- **Workflow fails**: Check the [Actions](../../actions) tab for detailed logs
46+
- **Version conflicts**: Ensure the release tag doesn't already exist on npm
47+
- **Permission issues**: Trusted publishing is configured via the npm package settings. Ensure the GitHub repository is linked as a trusted publisher on npmjs.com under the package's settings.

0 commit comments

Comments
 (0)