Skip to content

Commit

Permalink
chore: set up semantic release versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Aug 21, 2024
1 parent 1972b3f commit 8eeab8a
Show file tree
Hide file tree
Showing 6 changed files with 843 additions and 7 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,39 @@ on:
- hotfix/*

jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
environment: test
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm test

semantic-release:
needs: test
if: "!contains(github.event.head_commit.message, '[skip ci]')"

name: Semantic Release
runs-on: ubuntu-latest
environment: staging
permissions:
contents: write

Expand All @@ -25,7 +53,7 @@ jobs:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "lts/*"

Expand All @@ -44,7 +72,7 @@ jobs:
@semantic-release/changelog
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_PA_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Do something when a new release published
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
4 changes: 0 additions & 4 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ trailingComma: "all"
useTabs: false

overrides:
- files: "*.sol"
options:
compiler: "0.8.17"
tabWidth: 4
- files: "*.ts"
options:
importOrder: ["<THIRD_PARTY_MODULES>", "^[./]"]
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


export default [
{files: ["**/*.{js,mjs,cjs,ts}"]},
{languageOptions: { globals: {...globals.browser, ...globals.node} }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"devDependencies": {
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.9.0",
"@faker-js/faker": "^8.3.1",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
Expand All @@ -48,16 +49,22 @@
"chai-assertions-count": "^1.0.2",
"chai-subset": "^1.6.0",
"esbuild": "^0.19.8",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.9.0",
"husky": "^9.1.5",
"json-schema-to-typescript": "^13.1.1",
"lint-staged": "^15.2.9",
"orval": "^6.30.2",
"prettier": "3.3.3",
"rollup": "^3.29.4",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"sinon": "^17.0.1",
"typescript": "5.4.5",
"typescript-eslint": "^8.2.0",
"vitest": "^1.6.0"
},
"scripts": {
Expand All @@ -71,7 +78,15 @@
"test:watch": "vitest --watch",
"types:json": "pnpm json2ts -i './src/resources/schema/' -o 'src/types' --cwd './src/resources/schema'",
"prepare": "husky",
"commitlint": "commitlint --edit"
"commitlint": "commitlint --config commitlintrc.ts --edit"
},
"lint-staged": {
"*.{js, jsx,ts,tsx}": [
"eslint --quiet --fix"
],
"*.{json,js,ts,jsx,tsx,html}": [
"prettier --write --ignore-unknown"
]
},
"packageManager": "pnpm@9.2.0+sha256.94fab213df221c55b6956b14a2264c21c6203cca9f0b3b95ff2fe9b84b120390"
}
Loading

0 comments on commit 8eeab8a

Please sign in to comment.