Skip to content

Commit

Permalink
Merge pull request #199 from MeshJS/workflow/ci-deploy
Browse files Browse the repository at this point in the history
Workflow/ci deploy
  • Loading branch information
HinsonSIDAN authored Apr 5, 2024
2 parents c98a3a2 + f7441f8 commit e3c8ef0
Show file tree
Hide file tree
Showing 12 changed files with 1,601 additions and 1,056 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Build and Lint

on:
release:
types: [created]
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn ci
41 changes: 41 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn ci

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: yarn ci
- run: |
if [[ "${{ github.event.head_commit.message }}" =~ ^(docs:|chore:) ]]; then
echo "Skipping npm publish due to commit message."
else
cd packages/module && npm publish --access public
cd ../react && npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
yarn ci
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
31 changes: 27 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": true,
"scripts": {
"lerna": "lerna",
"ci": "yarn && yarn lint && yarn build:module && yarn build:react",
"bootstrap": "yarn install && yarn lerna bootstrap",
"start:cli": "lerna exec --scope create-mesh-dapp -- yarn dev",
"start:demo": "lerna exec --scope @meshsdk/playground -- yarn dev",
Expand All @@ -19,18 +20,40 @@
"build:contracts": "lerna exec --scope @meshsdk/contracts -- yarn build",
"build:module": "lerna exec --scope @meshsdk/core -- yarn build",
"build:react": "lerna exec --scope @meshsdk/react -- yarn build",
"build:docs": "lerna exec --scope @meshsdk/core -- yarn docs"
"build:docs": "lerna exec --scope @meshsdk/core -- yarn docs",
"prepare": "husky install",
"lint:docs": "lerna exec --scope @meshsdk/docs \"yarn eslint --fix\"",
"lint:demo": "lerna exec --scope @meshsdk/playground \"yarn eslint --fix\"",
"lint:module": "lerna exec --scope @meshsdk/core \"yarn eslint --fix\"",
"lint": "yarn lint:module && yarn lint:demo && yarn lint:docs"
},
"devDependencies": {
"@types/jest": "28.1.6",
"@types/node": "18.6.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"eslint": "8.16.0",
"eslint": "8.39.0",
"lerna": "^8.1.2",
"typescript": "4.8.2"
"typescript": "4.8.2",
"husky": "^9.0.11",
"@commitlint/cli": "^17.4.3",
"@commitlint/config-conventional": "^17.4.3",
"commitlint": "^17.4.3",
"prettier": "^2.8.8",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1"
},
"workspaces": [
"packages/*"
]
],
"lint-staged": {
"**/*.{js,ts,}": [
"yarn prettier --write"
]
}
}
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"vitest": "0.28.4"
},
"peerDependencies": {
"@meshsdk/core": "1.5.11-beta.6"
"@meshsdk/core": "1.5.11-beta.7"
},
"dependencies": {
"@harmoniclabs/plu-ts": "0.2.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^2.0.10",
"@meshsdk/contracts": "1.0.0-beta.4",
"@meshsdk/core": "1.5.11-beta.6",
"@meshsdk/core": "1.5.11-beta.7",
"@meshsdk/react": "*",
"copy-to-clipboard": "^3.3.2",
"flowbite": "^1.5.3",
Expand Down
Loading

0 comments on commit e3c8ef0

Please sign in to comment.