From 3014ca3f02663f586b630e78e7c52eb6292781ef Mon Sep 17 00:00:00 2001 From: dworac Date: Sat, 20 May 2023 16:05:51 -0600 Subject: [PATCH] feat: added workflows --- .github/workflows/publish-npm.yml | 25 +++++++++++++++++++++++++ .github/workflows/release-please.yml | 15 +-------------- 2 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/publish-npm.yml diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..1f24922 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,25 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - name: Run install + uses: borales/actions-yarn@v4 + with: + cmd: install # will run `yarn install` command + - name: Build production bundle + uses: borales/actions-yarn@v4 + with: + cmd: build # will run `yarn build:prod` command + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 05c6bb7..8215635 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -15,17 +15,4 @@ jobs: with: release-type: node package-name: release-please-action - # The logic below handles the npm publication: - - uses: actions/checkout@v2 - # these if statements ensure that a publication only occurs when - # a new release is created: - if: ${{ steps.release.outputs.release_created }} - - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: 'https://registry.npmjs.org' - if: ${{ steps.release.outputs.release_created }} - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - if: ${{ steps.release.outputs.release_created }} + token: ${{ secrets.MY_TOKEN }}