From f28b23b81b326dd88814fb1779429a45cfaa7cc5 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 4 May 2023 22:05:12 +0530 Subject: [PATCH] Add workflow file --- .github/workflows/sdk-release.js.yml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/sdk-release.js.yml diff --git a/.github/workflows/sdk-release.js.yml b/.github/workflows/sdk-release.js.yml new file mode 100644 index 00000000..85d35d14 --- /dev/null +++ b/.github/workflows/sdk-release.js.yml @@ -0,0 +1,46 @@ +# Must only be called from `release#published` triggers +name: Publish to npm +on: + push: + tags: + - sdk-v** +jobs: + npm: + name: Publish to npm + runs-on: ubuntu-latest + steps: + - name: 🧮 Checkout code + uses: actions/checkout@v3 + + - name: 🔧 Yarn cache + uses: actions/setup-node@v3 + with: + cache: "yarn" + registry-url: "https://registry.npmjs.org" + + - name: 🔨 Install dependencies + run: "yarn install --prefer-offline --frozen-lockfile" + + - name: Run Unit tests + run: "yarn test" + + - name: Run Lint Checks + run: "yarn run lint-ci" + + - name: Run Typescript Checks + run: "yarn run tsc" + + - name: Run SDK tests + run: "yarn test:sdk" + + - name: Build SDK + run: "yarn build:sdk" + + - name: 🚀 Publish to npm + id: npm-publish + uses: JS-DevTools/npm-publish@v2 + with: + token: ${{ secrets.NPM_TOKEN }} + access: public + package: ./target + dry-run: true