From f51c51034caf41224fadaad812f11620887799c2 Mon Sep 17 00:00:00 2001 From: Dean Tarisai Date: Thu, 28 Mar 2024 10:37:25 +0200 Subject: [PATCH] chore: added release-please workflow --- .github/workflows/npm-publish.yml | 34 ---------------------------- .github/workflows/release-please.yml | 24 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/npm-publish.yml create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml deleted file mode 100644 index 7ef390b5..00000000 --- a/.github/workflows/npm-publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -# 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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages - -name: NPM publish 📦 - -on: - release: - types: [published] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm i - - run: npm run code:publish - - run: npm test - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: npm i - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH}} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..860d2f55 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,24 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.GH_PAT }} + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: node