Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish Pyth SDK to crates.io

on:
release:
types:
- created
jobs:
publish-pyth-common-js:
name: Publish Pyth Common JS
if: ${{ startsWith(github.ref, "refs/tags/pyth-common-js:v") }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
working-directory: "pyth-common-js"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: "pyth-common-js"
publish-pyth-evm-js:
name: Publish Pyth EVM JS
if: ${{ startsWith(github.ref, "refs/tags/pyth-evm-js:v") }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
working-directory: "pyth-evm-js"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: "pyth-evm-js"
publish-pyth-terra-js:
name: Publish Pyth Common JS
if: ${{ startsWith(github.ref, "refs/tags/pyth-terra-js:v") }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
working-directory: "pyth-terra-js"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: "pyth-terra-js"
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ Please see the [pyth.network documentation](https://docs.pyth.network/) for more
### pre-commit hooks

We require the [pre-commit hooks](https://pre-commit.com/) defined in [`.pre-commit-config.yaml`](.pre-commit-config.yaml) to be ran on each PR before merging. To enable these to check and fix issues automatically in your local environment, install [pre-commit](https://pre-commit.com/) and run `pre-commit install` from the root of this repo.

## Releases

We use [Semantic Versioning](https://semver.org/) for our releases. In order to release a new version of any of the packages and publish it to npm, follow these steps:

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.
2. Once your change is merged into `main`, create a release with tag `<package>:v<new version number>` like `pyth-evm-js:v1.5.2`, and a github action will automatically publish the new version of this package to npm.
3 changes: 1 addition & 2 deletions pyth-common-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"version": "npm run format && git add -A src"
},
"keywords": [
"pyth",
Expand Down
3 changes: 1 addition & 2 deletions pyth-evm-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"version": "npm run format && git add -A src"
},
"keywords": [
"pyth",
Expand Down
3 changes: 1 addition & 2 deletions pyth-terra-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"version": "npm run format && git add -A src"
},
"keywords": [
"pyth",
Expand Down