Skip to content

Commit 65e3d07

Browse files
authored
fix: add github action support for monorepo (#63)
1 parent 9f7401d commit 65e3d07

File tree

9 files changed

+85
-65
lines changed

9 files changed

+85
-65
lines changed

.github/workflows/pr.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Conventional-pr
22
on:
33
pull_request:
4-
branches:
5-
- main
6-
- dev
74
types:
85
- opened
96
- edited

.github/workflows/release.yaml

+57-54
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,27 @@ jobs:
8787
name: js-doc
8888
path: docs/docs/typescript/api
8989
retention-days: 1
90-
- uses: JS-DevTools/npm-publish@v1
91-
name: Publish Package to NPM
92-
with:
93-
package: "sdk-dist/typescript/package.json"
94-
token: ${{ secrets.npm_token }}
95-
access: "public"
96-
- uses: JS-DevTools/npm-publish@v1
97-
name: Publish Package to GitHub Package
98-
with:
99-
package: "sdk-dist/typescript/package.json"
100-
registry: "https://npm.pkg.github.com"
101-
token: ${{ secrets.GITHUB_TOKEN }}
102-
access: "public"
103-
- name: Release umd module
104-
uses: softprops/action-gh-release@v1
90+
91+
- uses: healthplace/[email protected]
92+
name: Login to NPM registry
93+
with:
94+
scope: '@etherdata-blockchain'
95+
registry: 'registry.npmjs.org'
96+
auth-token: ${{ secrets.npm_token }}
97+
- name: Publish to npm
98+
run: yarn release
99+
working-directory: sdk-dist/typescript
100+
101+
- uses: healthplace/[email protected]
102+
name: Login to GitHub registry
105103
with:
106-
files: |
107-
./sdk-dist/typescript/etherdata-sdk.js
104+
scope: '@etherdata-blockchain'
105+
registry: 'https://npm.pkg.github.com'
106+
auth-token: ${{ secrets.GITHUB_TOKEN }}
107+
108+
- name: Publish to GitHub
109+
run: yarn release
110+
working-directory: sdk-dist/typescript
108111

109112
publish-react-ui-npm:
110113
needs: build
@@ -140,43 +143,43 @@ jobs:
140143
needs: build
141144
runs-on: ubuntu-latest
142145
steps:
143-
- uses: actions/checkout@master
144-
- name: Set up Python 3.9
145-
uses: actions/setup-python@v1
146-
with:
147-
python-version: 3.9
148-
- name: Install dependencies
149-
run: pip install -r requirements.txt
150-
working-directory: sdk-dist/python
151-
- run: python3 generator.py
152-
name: Building documentation
153-
working-directory: sdk-dist/python
154-
- name: Install pypa/build
155-
run: >-
156-
python -m
157-
pip install
158-
build
159-
--user
160-
working-directory: sdk-dist/python
161-
- name: Build a binary wheel and a source tarball
162-
run: >-
163-
python -m
164-
build
165-
--sdist
166-
--wheel
167-
--outdir dist/
168-
.
169-
working-directory: sdk-dist/python
170-
- name: Publish distribution 📦 to PyPI
171-
if: startsWith(github.ref, 'refs/tags')
172-
uses: pypa/gh-action-pypi-publish@master
173-
with:
174-
password: ${{ secrets.PYPI_API_TOKEN }}
175-
packages_dir: sdk-dist/python/dist
176-
- uses: actions/upload-artifact@v2
177-
with:
178-
name: python-doc
179-
path: docs/docs/python/api
146+
- uses: actions/checkout@master
147+
- name: Set up Python 3.9
148+
uses: actions/setup-python@v1
149+
with:
150+
python-version: 3.9
151+
- name: Install dependencies
152+
run: pip install -r requirements.txt
153+
working-directory: sdk-dist/python
154+
- run: python3 generator.py
155+
name: Building documentation
156+
working-directory: sdk-dist/python
157+
- name: Install pypa/build
158+
run: >-
159+
python -m
160+
pip install
161+
build
162+
--user
163+
working-directory: sdk-dist/python
164+
- name: Build a binary wheel and a source tarball
165+
run: >-
166+
python -m
167+
build
168+
--sdist
169+
--wheel
170+
--outdir dist/
171+
.
172+
working-directory: sdk-dist/python
173+
- name: Publish distribution 📦 to PyPI
174+
if: startsWith(github.ref, 'refs/tags')
175+
uses: pypa/gh-action-pypi-publish@master
176+
with:
177+
password: ${{ secrets.PYPI_API_TOKEN }}
178+
packages_dir: sdk-dist/python/dist
179+
- uses: actions/upload-artifact@v2
180+
with:
181+
name: python-doc
182+
path: docs/docs/python/api
180183

181184

182185
publish-docs:

.release-it.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"@release-it/bumper": {
1515
"out": [
1616
"sdk-dist/etd-react-ui/package.json",
17-
"sdk-dist/typescript/package.json"
17+
"sdk-dist/typescript/package.json",
18+
"sdk-dist/typescript/packages/**/package.json"
1819
]
1920
}
2021
},

sdk-dist/typescript/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"scripts": {
1515
"build": "turbo run build",
1616
"test": "turbo run test",
17-
"doc": "turbo run doc"
17+
"doc": "turbo run doc",
18+
"release": "turbo run release"
1819
},
1920
"devDependencies": {
2021
"turbo": "^1.2.4"

sdk-dist/typescript/packages/account/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"types": "dist/index.d.ts",
66
"license": "MIT",
77
"private": false,
8+
"publishConfig": {
9+
"access": "public"
10+
},
811
"dependencies": {
912
"web3-utils": "^1.7.3",
1013
"@ethereumjs/tx": "^3.5.1",
@@ -21,7 +24,8 @@
2124
"scripts": {
2225
"build": "tsc",
2326
"test": "jest --passWithNoTests",
24-
"doc": "typedoc --out ../../docs/js/account ./lib"
27+
"doc": "typedoc --out ../../docs/js/account ./lib",
28+
"release": "yarn publish"
2529
},
2630
"devDependencies": {
2731
"@types/jest": "^27.0.1",

sdk-dist/typescript/packages/common/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@
88
"dependencies": {
99
"ethereumjs-util": "^7.1.4"
1010
},
11+
"publishConfig": {
12+
"access": "public"
13+
},
1114
"repository": {
1215
"type": "git",
1316
"url": "https://github.com/etherdata-blockchain/etherdata-sdk.git"
1417
},
1518
"scripts": {
1619
"build": "tsc",
1720
"test": "jest --passWithNoTests",
18-
"doc": "typedoc --out ../../docs/js/common ./lib"
21+
"doc": "typedoc --out ../../docs/js/common ./lib",
22+
"release": "yarn publish"
1923
},
2024
"devDependencies": {
2125
"@types/jest": "^27.0.1",

sdk-dist/typescript/packages/file-browser/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"types": "dist/index.d.ts",
66
"license": "MIT",
77
"private": false,
8+
"publishConfig": {
9+
"access": "public"
10+
},
811
"dependencies": {
912
"@types/http-status-codes": "^1.2.0",
1013
"@types/url-join": "^4.0.1",
@@ -22,7 +25,8 @@
2225
"scripts": {
2326
"build": "tsc",
2427
"test": "jest --passWithNoTests",
25-
"doc": "typedoc --out ../../docs/js/file-browser ./lib"
28+
"doc": "typedoc --out ../../docs/js/file-browser ./lib",
29+
"release": "yarn publish"
2630
},
2731
"devDependencies": {
2832
"@types/jest": "^27.0.1",

sdk-dist/typescript/packages/file-node/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"url-join": "^4.0.1",
1616
"@etherdata-blockchain/etherdata-sdk-common": "*"
1717
},
18+
"publishConfig": {
19+
"access": "public"
20+
},
1821
"repository": {
1922
"type": "git",
2023
"url": "https://github.com/etherdata-blockchain/etherdata-sdk.git"
@@ -23,7 +26,8 @@
2326
"build": "tsc",
2427
"test": "jest --passWithNoTests",
2528
"doc": "typedoc --out ../../docs/js/file-node ./lib",
26-
"example": "ts-node lib/examples/file_example.ts"
29+
"example": "ts-node lib/examples/file_example.ts",
30+
"release": "yarn publish"
2731
},
2832
"devDependencies": {
2933
"@types/jest": "^27.0.1",

sdk-dist/typescript/turbo.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
"pipeline": {
55
"build": {
66
"dependsOn": ["^build"],
7-
"outputs": ["dist/**"],
8-
"cache": false
7+
"outputs": ["dist/**"]
98
},
109
"test": {
1110
"dependsOn": ["build"],
1211
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"]
1312
},
1413
"doc": {
1514
"dependsOn": ["build"]
15+
},
16+
"release": {
17+
1618
}
1719
}
1820
}

0 commit comments

Comments
 (0)