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-npm.yml b/.github/workflows/release-please-npm.yml new file mode 100644 index 00000000..15fefa8d --- /dev/null +++ b/.github/workflows/release-please-npm.yml @@ -0,0 +1,32 @@ +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: 20 + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - run: npm i + if: ${{ steps.release.outputs.release_created }} + - run: | + npm test + npm run code:publish + npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH}} + if: ${{ steps.release.outputs.release_created }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 70b26cc9..95546674 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -21,4 +21,7 @@ jobs: token: ${{ secrets.GH_PAT }} # this is a built-in strategy in release-please, see "Action Inputs" # for more options - release-type: node \ No newline at end of file + + release-type: node + + release-type: node diff --git a/CHANGELOG.md b/CHANGELOG.md index 197de3bc..8daa0c78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,13 @@ All notable changes to this project will be documented in this file. See [standa * fixed base distribution function to handle overrides with defaults ([f8c7c7c](https://github.com/xml-wizard/huetiful/commits/f8c7c7cd951bbd107fae2e686039edc40c672b45)) * fixed type errors in generators ([fce44cb](https://github.com/xml-wizard/huetiful/commits/fce44cbbe004e2cbfada167a32ad1292f7128585)) +## [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 @@ -59,4 +66,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