From dec2de4b5f0640be4da80a65895298f63f786cfa Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Wed, 13 Apr 2022 21:49:22 +0700 Subject: [PATCH] Create npm-publish-github-packages.yml --- .../workflows/npm-publish-github-packages.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/npm-publish-github-packages.yml diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml new file mode 100644 index 0000000..3b12690 --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -0,0 +1,37 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn --frozen-lockfile + - run: yarn build + + publish-gpr: + needs: build + runs-on: ubuntu-20.04 + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com/ + - run: yarn --frozen-lockfile + - run: yarn build + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}