From fce329a84a60b2eb44adcdb16799bb8235e33fc5 Mon Sep 17 00:00:00 2001 From: Dean Tarisai Date: Thu, 28 Mar 2024 10:24:13 +0200 Subject: [PATCH 1/5] feat: added release-please-npm.yml workflow to publish when a new release is merged --- .github/workflows/release-please-npm.yml | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/release-please-npm.yml diff --git a/.github/workflows/release-please-npm.yml b/.github/workflows/release-please-npm.yml new file mode 100644 index 00000000..1537dbbf --- /dev/null +++ b/.github/workflows/release-please-npm.yml @@ -0,0 +1,29 @@ +on: + push: + branches: + - main +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + id: release + with: + release-type: node + # The logic below handles the npm publication: + - uses: actions/checkout@v4 + # 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@v4 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - run: npm ci + if: ${{ steps.release.outputs.release_created }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH}} + if: ${{ steps.release.outputs.release_created }} From 291bd20aa48f6a5110c9702d1595bc2e81f37169 Mon Sep 17 00:00:00 2001 From: Dean Tarisai Date: Thu, 28 Mar 2024 10:28:41 +0200 Subject: [PATCH 2/5] chore: added scripts to test and compile code resources before pushing to npm --- .github/workflows/release-please-npm.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-please-npm.yml b/.github/workflows/release-please-npm.yml index 1537dbbf..15fefa8d 100644 --- a/.github/workflows/release-please-npm.yml +++ b/.github/workflows/release-please-npm.yml @@ -18,12 +18,15 @@ jobs: if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-node@v4 with: - node-version: 12 + node-version: 20 registry-url: 'https://registry.npmjs.org' if: ${{ steps.release.outputs.release_created }} - - run: npm ci + - run: npm i if: ${{ steps.release.outputs.release_created }} - - run: npm publish + - run: | + npm test + npm run code:publish + npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH}} if: ${{ steps.release.outputs.release_created }} From f51c51034caf41224fadaad812f11620887799c2 Mon Sep 17 00:00:00 2001 From: Dean Tarisai Date: Thu, 28 Mar 2024 10:37:25 +0200 Subject: [PATCH 3/5] 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 From 67fc9b2194a2038d66c03dbada503757882c29f4 Mon Sep 17 00:00:00 2001 From: Dean Tarisai Date: Thu, 28 Mar 2024 10:38:11 +0200 Subject: [PATCH 4/5] chore(main): release 2.2.0 --- CHANGELOG.md | 9 ++++++++- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52d0d263..2e6fec42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ Please note that the list of changes is not final and is still a work in progres +## [2.2.0](https://github.com/xml-wizard/huetiful/compare/v2.1.1...v2.2.0) (2024-03-28) + + +### Features + +* added release-please-npm.yml workflow to publish when a new release is merged ([fce329a](https://github.com/xml-wizard/huetiful/commit/fce329a84a60b2eb44adcdb16799bb8235e33fc5)) + ### 2.0.0 (stable) ##### Notable changes @@ -55,4 +62,4 @@ Which are similar to i.e `getNearestChroma` but take an additional against param [npm]: https://npmjs.org/package/huetiful-js [home]: https://prjctimg.io/huetiful -[converters]: https://prjctimg.io/huetiful/converters.html \ No newline at end of file +[converters]: https://prjctimg.io/huetiful/converters.html diff --git a/package-lock.json b/package-lock.json index d2e836b4..db052a17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "huetiful-js", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "huetiful-js", - "version": "2.1.0", + "version": "2.2.0", "bundleDependencies": [ "culori" ], diff --git a/package.json b/package.json index cf5a9db2..0dec0509 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "huetiful-js", - "version": "2.1.0", + "version": "2.2.0", "type": "module", "main": "./src/index.js", "browser": "./lib/huetiful.umd.js", From c622101e726b7caafe4b8a5c3234f39276b89583 Mon Sep 17 00:00:00 2001 From: Dean Tarisai Date: Sat, 30 Mar 2024 15:31:22 +0200 Subject: [PATCH 5/5] Update release-please.yml --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 860d2f55..c7c1cd93 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,7 +1,7 @@ on: push: branches: - - main + - dev permissions: contents: write