Skip to content

Commit e995a2b

Browse files
authored
Add CI workflow to publish javascript packages (#707)
* workflows * try private * private * more private * update files * fix workflow * hm * hm * bump version * bump version * another bump * text * update readme * update package lock
1 parent cbcc294 commit e995a2b

File tree

17 files changed

+1502
-1460
lines changed

17 files changed

+1502
-1460
lines changed

.github/workflows/publish-js.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish Pyth JS packages
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
jobs:
8+
publish-solidity-sdk:
9+
name: Publish Javascript Packages to NPM
10+
if: ${{ startsWith(github.ref, 'refs/tags/pyth-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: "16"
17+
registry-url: "https://registry.npmjs.org"
18+
- run: npm ci
19+
- run: npx lerna publish from-package --no-git-tag-version
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ and examples for your blockchain runtime in the `target_chains` directory.
4747

4848
### Releases
4949

50-
We use [Semantic Versioning](https://semver.org/) for our releases.
50+
The repository has a CI workflow that will release javascript packages whose version number has changed.
51+
To perform a release, follow these steps:
52+
53+
1. Update the version number in the `package.json` file for the package(s) you wish to release. Please follow [Semantic Versioning](https://semver.org/) for package versions.
54+
2. Submit a PR with the changes and merge them in to main.
55+
3. Create a new release in github with a tag of the form `pyth-js-v<number>`. You can simply increment the version number each time -- it doesn't affect any of the published information.
56+
4. When this release is published, it will automatically trigger a CI workflow to publish the updated packages to NPM.
57+
58+
If you have a javascript package that shouldn't be published, simply add `"private": "true"` to the `package.json` file
59+
and it will be excluded from the publishing workflow.
5160

5261
### pre-commit hooks
5362

governance/multisig_wh_message_builder/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"description": "Pyth Multisig Wormhole Message Builder",
55
"homepage": "https://pyth.network",
6+
"private": "true",
67
"main": "lib/index.js",
78
"types": "lib/index.d.ts",
89
"files": [

governance/xc_admin/packages/crank_executor/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "crank_executor",
33
"version": "0.0.0",
44
"description": "A crank to executed all executeReady multisig transaction",
5+
"private": "true",
56
"author": "",
67
"homepage": "https://github.com/pyth-network/pyth-crosschain",
78
"license": "ISC",

governance/xc_admin/packages/crank_pythnet_relayer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "crank_pythnet_relayer",
33
"version": "0.0.0",
44
"description": "A crank to relay pyth governance actions to pythnet",
5+
"private": "true",
56
"author": "",
67
"homepage": "https://github.com/pyth-network/pyth-crosschain",
78
"license": "ISC",

governance/xc_admin/packages/xc_admin_cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "xc_admin_cli",
33
"version": "0.0.0",
4+
"private": "true",
45
"description": "",
56
"author": "",
67
"homepage": "https://github.com/pyth-network/pyth-crosschain",

governance/xc_admin/packages/xc_admin_common/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "xc_admin_common",
33
"version": "0.0.0",
44
"description": "",
5+
"private": "true",
56
"author": "",
67
"homepage": "https://github.com/pyth-network/pyth-crosschain",
78
"license": "ISC",

governance/xc_governance_sdk_js/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@pythnetwork/xc-governance-sdk",
33
"version": "0.2.0",
44
"description": "Pyth Cross-chain Governance SDK",
5+
"private": "true",
56
"homepage": "https://pyth.network",
67
"main": "lib/index.js",
78
"types": "lib/index.d.ts",

0 commit comments

Comments
 (0)