Skip to content

Commit

Permalink
Merge pull request #22 from Gateway-DAO/beta
Browse files Browse the repository at this point in the history
feat ci/cd pipline
  • Loading branch information
R11manish authored Jan 19, 2024
2 parents 03d3613 + bd53903 commit ee91352
Show file tree
Hide file tree
Showing 12 changed files with 2,654 additions and 1,434 deletions.
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ test/*
.mesh/*
__mocks__/*
lib/*
custom-fetch.js
coverage/*
dist/*
custom-fetch.js
commitlint.config.js
release.config.js
.husky/*
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches: [main]

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install pnpm
run: npm install -g pnpm@7.33.5
- name: Install dependencies
run: pnpm install
- name: Install semantic-release extra plugins
run: pnpm install -D @semantic-release/changelog @semantic-release/git
- name: Lint
run: pnpm lint
- name: Build Graphql queries
run: pnpm mesh build
- name: Format code
run: pnpm format
- name: Test
run: pnpm test
- name: Build
run: pnpm build
# - name: Release
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: pnpm dlx semantic-release@22.0.12
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-install commitlint --edit "$1"
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged


6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [2, 'always', 200],
},
};
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gateway-dao/sdk",
"version": "0.0.0",
"version": "0.0.0-semantic-release",
"description": "A Typescript SDK for the Gateway API",
"main": "dist/src/Gateway.js",
"types": "dist/src/Gateway.d.ts",
Expand All @@ -9,8 +9,15 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"prepare": "husky install",
"build": "tsc"
},
"lint-staged": {
"*.ts": [
"pnpm format",
"pnpm lint"
]
},
"files": [
"dist"
],
Expand All @@ -31,6 +38,8 @@
"graphql": "^16.8.1"
},
"devDependencies": {
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.13.2",
Expand All @@ -41,13 +50,18 @@
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Gateway-DAO/gateway-js-sdk.git"
},
"publishConfig": {
"access": "public"
}
}
}
Loading

0 comments on commit ee91352

Please sign in to comment.