Jelajahi Sumber

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
Jayant Krishnamurthy 2 tahun lalu
induk
melakukan
e995a2b89e

+ 21 - 0
.github/workflows/publish-js.yml

@@ -0,0 +1,21 @@
+name: Publish Pyth JS packages
+
+on:
+  release:
+    types:
+      - created
+jobs:
+  publish-solidity-sdk:
+    name: Publish Javascript Packages to NPM
+    if: ${{ startsWith(github.ref, 'refs/tags/pyth-js-v') }}
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-node@v2
+        with:
+          node-version: "16"
+          registry-url: "https://registry.npmjs.org"
+      - run: npm ci
+      - run: npx lerna publish from-package --no-git-tag-version
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 10 - 1
README.md

@@ -47,7 +47,16 @@ and examples for your blockchain runtime in the `target_chains` directory.
 
 ### Releases
 
-We use [Semantic Versioning](https://semver.org/) for our releases.
+The repository has a CI workflow that will release javascript packages whose version number has changed.
+To perform a release, follow these steps:
+
+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.
+2. Submit a PR with the changes and merge them in to main.
+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.
+4. When this release is published, it will automatically trigger a CI workflow to publish the updated packages to NPM.
+
+If you have a javascript package that shouldn't be published, simply add `"private": "true"` to the `package.json` file
+and it will be excluded from the publishing workflow.
 
 ### pre-commit hooks
 

+ 1 - 0
governance/multisig_wh_message_builder/package.json

@@ -3,6 +3,7 @@
   "version": "0.1.0",
   "description": "Pyth Multisig Wormhole Message Builder",
   "homepage": "https://pyth.network",
+  "private": "true",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
   "files": [

+ 1 - 0
governance/xc_admin/packages/crank_executor/package.json

@@ -2,6 +2,7 @@
   "name": "crank_executor",
   "version": "0.0.0",
   "description": "A crank to executed all executeReady multisig transaction",
+  "private": "true",
   "author": "",
   "homepage": "https://github.com/pyth-network/pyth-crosschain",
   "license": "ISC",

+ 1 - 0
governance/xc_admin/packages/crank_pythnet_relayer/package.json

@@ -2,6 +2,7 @@
   "name": "crank_pythnet_relayer",
   "version": "0.0.0",
   "description": "A crank to relay pyth governance actions to pythnet",
+  "private": "true",
   "author": "",
   "homepage": "https://github.com/pyth-network/pyth-crosschain",
   "license": "ISC",

+ 1 - 0
governance/xc_admin/packages/xc_admin_cli/package.json

@@ -1,6 +1,7 @@
 {
   "name": "xc_admin_cli",
   "version": "0.0.0",
+  "private": "true",
   "description": "",
   "author": "",
   "homepage": "https://github.com/pyth-network/pyth-crosschain",

+ 1 - 0
governance/xc_admin/packages/xc_admin_common/package.json

@@ -2,6 +2,7 @@
   "name": "xc_admin_common",
   "version": "0.0.0",
   "description": "",
+  "private": "true",
   "author": "",
   "homepage": "https://github.com/pyth-network/pyth-crosschain",
   "license": "ISC",

+ 1 - 0
governance/xc_governance_sdk_js/package.json

@@ -2,6 +2,7 @@
   "name": "@pythnetwork/xc-governance-sdk",
   "version": "0.2.0",
   "description": "Pyth Cross-chain Governance SDK",
+  "private": "true",
   "homepage": "https://pyth.network",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",

File diff ditekan karena terlalu besar
+ 330 - 695
package-lock.json


+ 1 - 1
price_pusher/package.json

@@ -1,5 +1,5 @@
 {
-  "name": "@pythnetwork/pyth-price-pusher",
+  "name": "@pythnetwork/price-pusher",
   "version": "4.1.1",
   "description": "Pyth Price Pusher",
   "homepage": "https://pyth.network",

+ 5 - 1
price_service/client/js/package.json

@@ -11,7 +11,11 @@
   "files": [
     "lib/**/*"
   ],
-  "repository": "https://github.com/pyth-network/pyth-crosschain",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/pyth-network/pyth-crosschain",
+    "directory": "price_service/client/js"
+  },
   "scripts": {
     "test": "jest --testPathIgnorePatterns=.*.e2e.test.ts --passWithNoTests",
     "test:e2e": "jest --testPathPattern=.*.e2e.test.ts",

+ 1 - 0
price_service/server/package.json

@@ -2,6 +2,7 @@
   "name": "@pythnetwork/price-service-server",
   "version": "3.0.0",
   "description": "Webservice for retrieving prices from the Pyth oracle.",
+  "private": "true",
   "main": "index.js",
   "scripts": {
     "format": "prettier --write \"src/**/*.ts\"",

+ 1 - 1
target_chains/aptos/sdk/js/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/pyth-aptos-js",
-  "version": "1.0.0",
+  "version": "1.0.1",
   "description": "Pyth Network Aptos Utilities",
   "homepage": "https://pyth.network",
   "author": {

+ 1 - 0
target_chains/ethereum/contracts/package.json

@@ -2,6 +2,7 @@
   "name": "@pythnetwork/pyth-evm-contract",
   "version": "1.2.0",
   "description": "",
+  "private": "true",
   "devDependencies": {
     "@openzeppelin/test-helpers": "^0.5.15",
     "@openzeppelin/truffle-upgrades": "^1.14.0",

+ 1 - 1
target_chains/ethereum/sdk/solidity/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/pyth-sdk-solidity",
-  "version": "2.2.0",
+  "version": "2.2.1",
   "description": "Read prices from the Pyth oracle",
   "repository": {
     "type": "git",

+ 1 - 0
third_party/pyth/p2w-relay/package.json

@@ -2,6 +2,7 @@
   "name": "pyth_relay",
   "version": "1.0.0",
   "description": "Pyth relayer",
+  "private": "true",
   "main": "index.js",
   "scripts": {
     "build": "npm run build-evm && npm run build-lib",

+ 1 - 0
wormhole_attester/sdk/js/package.json

@@ -2,6 +2,7 @@
   "name": "@pythnetwork/wormhole-attester-sdk",
   "version": "1.0.0",
   "description": "Pyth Wormhole Attester SDk",
+  "private": "true",
   "types": "lib/index.d.ts",
   "main": "lib/index.js",
   "files": [

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini