From 38d1dd856996c8198e1ff217760d621b1d090906 Mon Sep 17 00:00:00 2001 From: BJ Vicks Date: Wed, 4 Oct 2023 13:46:25 -0700 Subject: [PATCH] add github release workflow --- .github/workflows/on-create-release.yml | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/on-create-release.yml diff --git a/.github/workflows/on-create-release.yml b/.github/workflows/on-create-release.yml new file mode 100644 index 0000000..7a69a14 --- /dev/null +++ b/.github/workflows/on-create-release.yml @@ -0,0 +1,38 @@ +name: Publish to NPM + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18] + steps: + - name: Clone repository + uses: actions/checkout@v4 + + - name: Set up PNPM + - uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + + # Navigate to the specific package directory within the monorepo + - name: Change to package directory + run: cd packages/sdk + + - name: Install dependencies and build 🔧 + run: pnpm ci && pnpm build + + - name: Publish package on NPM 📦 + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} \ No newline at end of file