Skip to content

Commit

Permalink
update: ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
pyadav committed Oct 3, 2023
1 parent 8eb933e commit 6116df1
Show file tree
Hide file tree
Showing 5 changed files with 1,270 additions and 22 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
name: release
name: sdk

on:
push:
branches:
- main
paths:
- "sdks/js/.changeset/**"
- ".github/workflows/js-sdk.yml"
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
Expand All @@ -19,8 +13,9 @@ jobs:
defaults:
run:
working-directory: ./sdks/js

steps:
- name: Checkout Repo
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
fetch-depth: 0
Expand All @@ -30,21 +25,23 @@ jobs:
with:
version: 8.6.9

- name: Setup Node.js 18.x
- name: Setup Node.js 20.x
uses: actions/setup-node@v2
with:
node-version: 18.x
node-version: 20.x

- name: Install Dependencies
- name: Install Dependencies 🔧
run: pnpm i

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
- name: Build Step 🔧
env:
CI: ''
run: npm run ci:build

- name: Run Semantic Release 🚀
run: npm run release
with:
version: pnpm ci:version
publish: pnpm ci:release
cwd: "./sdks/js"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 5 additions & 2 deletions sdks/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"dev": "turbo run dev",
"lint": "turbo run lint",
"clean": "turbo run clean",
"release": "turbo run release",
"changeset": "changeset",
"prettier-check": "prettier --check \"**/*.{js,ts,tsx,md,mdx}\"",
"prettier-fix": "prettier --write \"**/*.{js,ts,tsx,md,mdx}\"",
"ci:version": "changeset version",
"ci:release": "turbo build --filter=@raystack/frontier... && changeset publish"
"ci:build": "turbo build --filter=@raystack/frontier..."
},
"devDependencies": {
"@turbo/gen": "^1.10.14",
Expand All @@ -30,5 +30,8 @@
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "none"
},
"engines": {
"node": ">=20.6.1"
}
}
29 changes: 29 additions & 0 deletions sdks/js/packages/core/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"debug": true,
"branches": [
"main",
"changelog"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
8 changes: 8 additions & 0 deletions sdks/js/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dev": "tsup --watch src",
"size": "size-limit",
"lint": "eslint \"./**/*.ts*\"",
"release": "semantic-release",
"test": "echo \"Error: no test specified\" && exit 0",
"gen:client": "npx swagger-typescript-api -p ../../../../proto/apidocs.swagger.yaml -o client --modular"
},
Expand Down Expand Up @@ -50,6 +51,13 @@
"devDependencies": {
"@radix-ui/react-icons": "^1.3.0",
"@raystack/frontier-tsconfig": "workspace:^",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.0.0",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.1",
"@semantic-release/npm": "^11.0.0",
"@semantic-release/release-notes-generator": "^12.0.0",
"@size-limit/preset-small-lib": "^8.2.6",
"@tanstack/react-table": "^8.10.1",
"@types/node": "^20.6.3",
Expand Down
Loading

0 comments on commit 6116df1

Please sign in to comment.