Skip to content

Commit

Permalink
add publish CI
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 26, 2023
1 parent 4f714fa commit 40c6c0f
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 22 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish
on:
push:

jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- '@acala-network/type-definitions'
- '@acala-network/types'
- '@acala-network/api-derive'
- '@acala-network/api'

steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: git config email
run: git config --local user.email [email protected]

- name: git config name
run: git config --local user.name Bodhibot

- name: setup node env
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
run: yarn install --immutable

- name: build packages
run: yarn build

# Writes token to .yarnrc.yml. If written directly in .yarnrc.yml, it will cause an error
- run: |
echo npmAuthToken: "\${NPM_AUTH_TOKEN}" >> ./.yarnrc.yml
- name: publish ${{ matrix.package }}
run: |
# version containing a hyphen, publish as beta, i.e: 1.0.0-1
if npm pkg get version --workspace ${{ matrix.package }} | jq '."${{ matrix.package }}"' | grep '-'; then TAG='--tag beta'; fi
yarn workspace ${{ matrix.package }} npm publish --tolerate-republish --access public $TAG
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- run: |
git checkout ./.yarnrc.yml
29 changes: 28 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"lint": "polkadot-dev-run-lint",
"postinstall": "polkadot-dev-yarn-only",
"test": "echo noop",
"update-metadata": "ts-node --project ./tsconfig.json packages/types/scripts/updateMetadata.ts"
"update-metadata": "ts-node --project ./tsconfig.json packages/types/scripts/updateMetadata.ts",
"bump": "yarn workspaces foreach -vit --include '@acala-network/*' version"
},
"devDependencies": {
"@babel/core": "^7.21.8",
Expand All @@ -44,5 +45,31 @@
"versions": {
"npm": "5.1.1",
"git": "5.1.1"
},
"paths": {
"@acala-network/type-definitions": [
"packages/type-definitions/src"
],
"@acala-network/type-definitions/*": [
"packages/type-definitions/src/*"
],
"@acala-network/types": [
"packages/types/src"
],
"@acala-network/types/*": [
"packages/types/src/*"
],
"@acala-network/api-derive": [
"packages/api-derive/src"
],
"@acala-network/api-derive/*": [
"packages/api-derive/src/*"
],
"@acala-network/api": [
"packages/api/src"
],
"@acala-network/api/*": [
"packages/api/src/*"
]
}
}
7 changes: 4 additions & 3 deletions packages/api-derive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/api-derive",
"version": "5.1.1",
"version": "5.1.2-2",
"description": "Additional polkadot.js derives for Acala Network",
"main": "index.js",
"author": "Acala Developers <[email protected]>",
Expand All @@ -22,12 +22,13 @@
"build": "tsc --build tsconfig.json"
},
"dependencies": {
"@acala-network/types": "5.1.1"
"@acala-network/types": "workspace:*"
},
"peerDependencies": {
"@polkadot/api": "^10.5.1"
},
"devDependencies": {
"typescript": "^5.0.4"
}
},
"stableVersion": "5.1.1"
}
14 changes: 9 additions & 5 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "@acala-network/api",
"version": "5.1.1",
"version": "5.1.2-2",
"description": "Acala JS API",
"main": "index.js",
"main": "build/index.js",
"author": "Acala Developers <[email protected]>",
"license": "Apache-2.0",
"files": [
"build"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand All @@ -22,13 +25,14 @@
"build": "tsc --build tsconfig.json"
},
"dependencies": {
"@acala-network/api-derive": "5.1.1",
"@acala-network/types": "5.1.1"
"@acala-network/api-derive": "workspace:*",
"@acala-network/types": "workspace:*"
},
"peerDependencies": {
"@polkadot/api": "^10.5.1"
},
"devDependencies": {
"typescript": "^5.0.4"
}
},
"stableVersion": "5.1.1"
}
5 changes: 3 additions & 2 deletions packages/type-definitions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/type-definitions",
"version": "5.1.1",
"version": "5.1.2-2",
"description": "Polkadot.js type definations for Acala Network",
"main": "index.js",
"author": "Acala Developers <[email protected]>",
Expand All @@ -26,5 +26,6 @@
},
"devDependencies": {
"typescript": "^5.0.4"
}
},
"stableVersion": "5.1.1"
}
7 changes: 4 additions & 3 deletions packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/types",
"version": "5.1.1",
"version": "5.1.2-2",
"description": "Polkadot.js type definations for Acala Network",
"main": "index.js",
"author": "Acala Developers <[email protected]>",
Expand All @@ -22,7 +22,7 @@
"build": "tsc --build tsconfig.json"
},
"dependencies": {
"@acala-network/type-definitions": "5.1.1"
"@acala-network/type-definitions": "workspace:*"
},
"peerDependencies": {
"@polkadot/api": "^10.5.1"
Expand All @@ -31,5 +31,6 @@
"@types/websocket": "^1.0.5",
"typescript": "^5.0.4",
"websocket": "^1.0.34"
}
},
"stableVersion": "5.1.1"
}
2 changes: 1 addition & 1 deletion packages/types/scripts/updateMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'fs';
import { w3cwebsocket as WebSocket } from 'websocket';

const main = (): void => {
const endpoint = 'wss://acala-rpc-0.aca-api.network';
const endpoint = 'wss://acala-rpc.aca-api.network';

console.log('Connecting to ', endpoint);
const ws = new WebSocket(endpoint);
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ __metadata:
version: 6
cacheKey: 8

"@acala-network/api-derive@5.1.1, @acala-network/api-derive@workspace:packages/api-derive":
"@acala-network/api-derive@workspace:*, @acala-network/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@acala-network/api-derive@workspace:packages/api-derive"
dependencies:
"@acala-network/types": 5.1.1
"@acala-network/types": "workspace:*"
typescript: ^5.0.4
peerDependencies:
"@polkadot/api": ^10.5.1
Expand All @@ -20,15 +20,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@acala-network/api@workspace:packages/api"
dependencies:
"@acala-network/api-derive": 5.1.1
"@acala-network/types": 5.1.1
"@acala-network/api-derive": "workspace:*"
"@acala-network/types": "workspace:*"
typescript: ^5.0.4
peerDependencies:
"@polkadot/api": ^10.5.1
languageName: unknown
linkType: soft

"@acala-network/type-definitions@5.1.1, @acala-network/type-definitions@workspace:packages/type-definitions":
"@acala-network/type-definitions@workspace:*, @acala-network/type-definitions@workspace:packages/type-definitions":
version: 0.0.0-use.local
resolution: "@acala-network/type-definitions@workspace:packages/type-definitions"
dependencies:
Expand All @@ -38,11 +38,11 @@ __metadata:
languageName: unknown
linkType: soft

"@acala-network/types@5.1.1, @acala-network/types@workspace:packages/types":
"@acala-network/types@workspace:*, @acala-network/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@acala-network/types@workspace:packages/types"
dependencies:
"@acala-network/type-definitions": 5.1.1
"@acala-network/type-definitions": "workspace:*"
"@types/websocket": ^1.0.5
typescript: ^5.0.4
websocket: ^1.0.34
Expand Down

0 comments on commit 40c6c0f

Please sign in to comment.