From 960cf4d19f0f71100e31e4f372d81cfcf9d0053e Mon Sep 17 00:00:00 2001 From: Charlie McBride <33269602+charliedmcb@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:24:52 -0700 Subject: [PATCH] chore(release): configure semantic-release automation (#433) * update .releaserc.yaml * add perms to release * add GITHUB_TOKEN * add install of the dev dep * add presetConfig * cat noop * change ordering to cat the file * add --input-type=module * add package.json * add random input * change args * update package.json * remove run * update trigger file again * remove package.json and update release ref * update to locking version 24 (latest) * update release settings to what we want * update settings file to json and add comment --------- Co-authored-by: Charlie McBride --- .github/workflows/release-trigger.yaml | 12 +++++- .releaserc.json | 53 ++++++++++++++++++++++++++ .releaserc.yaml | 9 ----- 3 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 .releaserc.json delete mode 100644 .releaserc.yaml diff --git a/.github/workflows/release-trigger.yaml b/.github/workflows/release-trigger.yaml index 2a4d1bdd9..3194afc38 100644 --- a/.github/workflows/release-trigger.yaml +++ b/.github/workflows/release-trigger.yaml @@ -8,7 +8,9 @@ on: jobs: generate-sem-ver: permissions: - contents: read + contents: write + issues: write + pull-requests: write runs-on: ubuntu-latest steps: - name: Harden Runner @@ -22,5 +24,11 @@ jobs: with: node-version: '20.x' # semantic-release requires Node version 20.8.1 or higher - name: semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - npx semantic-release@18 \ No newline at end of file + npm install conventional-changelog-conventionalcommits -D + # Using the current latest major version of semantic-release v24, to + # prevent automated breaking changes, but still pickup features and patches ASAP. + # Will need to adopt new major versions as they are released. + npx semantic-release@24 \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 000000000..758bb80f6 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,53 @@ +{ + "branches": ["main"], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "presetConfig": { + "header": "Changelog", + "types": [ + {"type": "feat", "section": "Features"}, + {"type": "fix", "section": "Bug Fixes"}, + {"type": "chore", "hidden": true}, + {"type": "docs", "hidden": true}, + {"type": "style", "hidden": true}, + {"type": "refactor", "hidden": true}, + {"type": "perf", "hidden": true}, + {"type": "test", "hidden": true} + ], + "preMajor": true + } + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "header": "Changelog", + "types": [ + {"type": "feat", "section": "Features"}, + {"type": "fix", "section": "Bug Fixes"}, + {"type": "chore", "hidden": true}, + {"type": "docs", "hidden": true}, + {"type": "style", "hidden": true}, + {"type": "refactor", "hidden": true}, + {"type": "perf", "hidden": true}, + {"type": "test", "hidden": true} + ], + "preMajor": true + } + } + ], + [ + "@semantic-release/github", + { + "draftRelease": true, + "successComment": false, + "releasedLabels": false + } + ] + ] +} \ No newline at end of file diff --git a/.releaserc.yaml b/.releaserc.yaml deleted file mode 100644 index cf2e44e41..000000000 --- a/.releaserc.yaml +++ /dev/null @@ -1,9 +0,0 @@ -{ - "branches": ["main"], - "dryRun": true, - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/github" - ] -} \ No newline at end of file