From 1174ebd59578bfe925b62f976fc566d63ffe5286 Mon Sep 17 00:00:00 2001 From: AdityaKantipudi1 <160830373+AdityaKantipudi1@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:22:36 +0530 Subject: [PATCH] Create publish.yml --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a9fde95 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: 'Publish to NPM Registry' + +on: + release: + types: [published] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + cache: 'yarn' + + - name: Install Dependencies + run: yarn install + + - name: Build Package + run: yarn prepare # Uses bob build as defined in your package.json + + - name: Run Tests + run: yarn test + + - name: Publish to NPM + run: yarn publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}