From dcff9496234fd742c510de0d2fa32d071777569d Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" <45411113+vovikhangcdv@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:26:05 +0700 Subject: [PATCH 1/4] Create publish-github-package.yml --- .github/workflows/publish-github-package.yml | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish-github-package.yml diff --git a/.github/workflows/publish-github-package.yml b/.github/workflows/publish-github-package.yml new file mode 100644 index 0000000..a557c9e --- /dev/null +++ b/.github/workflows/publish-github-package.yml @@ -0,0 +1,38 @@ +# 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: Publish Github Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + 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/ + scopes: "@vovikhangcdv" + access: public + - run: npm ci + - run: npm publish --access public --scope "@vovikhangcdv" --registry-url https://npm.pkg.github.com/ + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 7e96c147149a239c0e61159c42fa8a32f1f81c8e Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" <45411113+vovikhangcdv@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:28:46 +0700 Subject: [PATCH 2/4] Update publish-github-package.yml --- .github/workflows/publish-github-package.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish-github-package.yml b/.github/workflows/publish-github-package.yml index a557c9e..886711b 100644 --- a/.github/workflows/publish-github-package.yml +++ b/.github/workflows/publish-github-package.yml @@ -4,6 +4,9 @@ name: Publish Github Package on: + push: + branches: + - main release: types: [created] From 45b8b81838c240f1926a7749f2f3bab8af2e2993 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" <45411113+vovikhangcdv@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:32:20 +0700 Subject: [PATCH 3/4] Create publish-npm-package.yml --- .github/workflows/publish-npm-package.yml | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish-npm-package.yml diff --git a/.github/workflows/publish-npm-package.yml b/.github/workflows/publish-npm-package.yml new file mode 100644 index 0000000..67c39bb --- /dev/null +++ b/.github/workflows/publish-npm-package.yml @@ -0,0 +1,33 @@ +# 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: Publish NPM Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} From 3107e0e4e004f4b2c5824a5a8f5ca5bd5c0c9b72 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" <45411113+vovikhangcdv@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:32:59 +0700 Subject: [PATCH 4/4] Update publish-github-package.yml --- .github/workflows/publish-github-package.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish-github-package.yml b/.github/workflows/publish-github-package.yml index 886711b..a557c9e 100644 --- a/.github/workflows/publish-github-package.yml +++ b/.github/workflows/publish-github-package.yml @@ -4,9 +4,6 @@ name: Publish Github Package on: - push: - branches: - - main release: types: [created]