diff --git a/.github/workflows/js-sdk.yml b/.github/workflows/js-sdk.yml new file mode 100644 index 000000000..1c039bf1e --- /dev/null +++ b/.github/workflows/js-sdk.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + branches: + - main + paths: + - '.changeset/**' + - '.github/workflows/js-sdk.yml' + workflow_dispatch: + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + timeout-minutes: 10 + working-directory: ./sdks/js + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup pnpm 8 + uses: pnpm/action-setup@v2 + with: + version: 8.6.9 + + - name: Setup Node.js 18.x + uses: actions/setup-node@v2 + with: + node-version: 18.x + + - name: Install Dependencies + run: pnpm i + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + version: pnpm ci:version + publish: pnpm ci:release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/sdks/js/.changeset/calm-kids-compete.md b/sdks/js/.changeset/calm-kids-compete.md deleted file mode 100644 index cfe9a43cb..000000000 --- a/sdks/js/.changeset/calm-kids-compete.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@raystack/frontier': 0.0.0 ---- - -Release first version of @raystack/frontier diff --git a/sdks/js/package.json b/sdks/js/package.json index 282e30d3d..0fafa71cd 100644 --- a/sdks/js/package.json +++ b/sdks/js/package.json @@ -7,9 +7,10 @@ "lint": "turbo run lint", "clean": "turbo run clean", "changeset": "changeset", - "version-packages": "changeset version", "prettier-check": "prettier --check \"**/*.{js,ts,tsx,md,mdx}\"", - "prettier-fix": "prettier --write \"**/*.{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" }, "devDependencies": { "@turbo/gen": "^1.9.7",