Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Commit 58421e4

Browse files
authored
Add publish github action (#4)
* Add publish github action * Remove github push
1 parent aa08ec0 commit 58421e4

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Node.js Package Publish
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v2
11+
with:
12+
node-version: '12.x'
13+
registry-url: 'https://registry.npmjs.org'
14+
- run: npm ci
15+
- run: npm publish --access public
16+
env:
17+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Pyth SDK JS
2+
The Pyth JavaScript SDK provides definitions and utilities for Pyth data structures.
3+
4+
Please see the [pyth.network documentation](https://docs.pyth.network/) for more information on how to use Pyth prices in various blockchains.
5+
6+
## Releases
7+
8+
We use [Semantic Versioning](https://semver.org/) for our releases. In order to release a new version of this package and publish it to npm, follow these steps:
9+
1. Run `npm version <new version number> --no-git-tag-version`. This command will update the version of the package. Then push your changes to github.
10+
2. Once your change is merged into `main`, create a release with tag `v<new version number>` like `v1.5.2`, and a github action will automatically publish the new version of this package to npm.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"prepare": "npm run build",
1919
"prepublishOnly": "npm test && npm run lint",
2020
"preversion": "npm run lint",
21-
"version": "npm run format && git add -A src",
22-
"postversion": "git push && git push --tags"
21+
"version": "npm run format && git add -A src"
2322
},
2423
"keywords": [
2524
"pyth",

0 commit comments

Comments
 (0)