Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit 60d25e1

Browse files
authored
Add github publish action (#18)
1 parent a364898 commit 60d25e1

File tree

5 files changed

+65
-6
lines changed

5 files changed

+65
-6
lines changed

.github/workflows/publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish Pyth SDK to crates.io
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
jobs:
8+
publish-pyth-common-js:
9+
name: Publish Pyth Common JS
10+
if: ${{ startsWith(github.ref, "refs/tags/pyth-common-js:v") }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: "12.x"
17+
registry-url: "https://registry.npmjs.org"
18+
- run: npm ci
19+
working-directory: "pyth-common-js"
20+
- run: npm publish --access public
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
working-directory: "pyth-common-js"
24+
publish-pyth-evm-js:
25+
name: Publish Pyth EVM JS
26+
if: ${{ startsWith(github.ref, "refs/tags/pyth-evm-js:v") }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions/setup-node@v2
31+
with:
32+
node-version: "12.x"
33+
registry-url: "https://registry.npmjs.org"
34+
- run: npm ci
35+
working-directory: "pyth-evm-js"
36+
- run: npm publish --access public
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
working-directory: "pyth-evm-js"
40+
publish-pyth-terra-js:
41+
name: Publish Pyth Common JS
42+
if: ${{ startsWith(github.ref, "refs/tags/pyth-terra-js:v") }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: actions/setup-node@v2
47+
with:
48+
node-version: "12.x"
49+
registry-url: "https://registry.npmjs.org"
50+
- run: npm ci
51+
working-directory: "pyth-terra-js"
52+
- run: npm publish --access public
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
working-directory: "pyth-terra-js"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ Please see the [pyth.network documentation](https://docs.pyth.network/) for more
1414
### pre-commit hooks
1515

1616
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.
17+
18+
## Releases
19+
20+
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:
21+
22+
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.
23+
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.

pyth-common-js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"prepare": "npm run build",
2222
"prepublishOnly": "npm test && npm run lint",
2323
"preversion": "npm run lint",
24-
"version": "npm run format && git add -A src",
25-
"postversion": "git push && git push --tags"
24+
"version": "npm run format && git add -A src"
2625
},
2726
"keywords": [
2827
"pyth",

pyth-evm-js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"prepare": "npm run build",
2323
"prepublishOnly": "npm test && npm run lint",
2424
"preversion": "npm run lint",
25-
"version": "npm run format && git add -A src",
26-
"postversion": "git push && git push --tags"
25+
"version": "npm run format && git add -A src"
2726
},
2827
"keywords": [
2928
"pyth",

pyth-terra-js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
"prepare": "npm run build",
2323
"prepublishOnly": "npm test && npm run lint",
2424
"preversion": "npm run lint",
25-
"version": "npm run format && git add -A src",
26-
"postversion": "git push && git push --tags"
25+
"version": "npm run format && git add -A src"
2726
},
2827
"keywords": [
2928
"pyth",

0 commit comments

Comments
 (0)