From 61ad5809d2fe9c5c17698944b70c65a40b94280a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Delgatte?= Date: Wed, 9 Oct 2024 15:55:10 +0200 Subject: [PATCH] feat: split release-please and semantic-release workflow --- .github/workflows/semantic-release-v1.yml | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/semantic-release-v1.yml diff --git a/.github/workflows/semantic-release-v1.yml b/.github/workflows/semantic-release-v1.yml new file mode 100644 index 0000000..a6eda8e --- /dev/null +++ b/.github/workflows/semantic-release-v1.yml @@ -0,0 +1,81 @@ +--- +name: Semantic releases + +on: + workflow_call: + inputs: + runs_on: + type: string + default: ubuntu-latest + +jobs: + semantic-release: + runs-on: ${{ inputs.runs_on }} + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get app token + id: app_token + uses: sencrop/github-workflows/actions/authenticate-github-app@master + with: + credentials: ${{ secrets.SENCROP_BOT_CREDENTIALS_TOKEN }} + + - name: Write .releaserc + run: | + echo '{ + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "releaseRules": [ + { "type": "feat", "release": "minor" }, + { "type": "fix", "release": "patch" }, + { "type": "refactor", "release": "patch" }, + { "type": "chore", "release": "patch" }, + { "type": "docs", "release": "patch" }, + { "type": "deps", "release": "patch" }, + { "type": "ci", "release": "patch" }, + { "type": "perf", "release": "patch" }, + { "type": "build", "release": "patch" }, + { "type": "style", "release": "patch" }, + { "type": "test", "release": "patch" } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { "type": "feat", "section": "New features", "hidden": false }, + { "type": "fix", "section": "Bug fixes", "hidden": false }, + { "type": "chore", "section": "Miscellaneous Chores", "hidden": false }, + { "type": "refactor", "section": "Code refactoring", "hidden": false }, + { "type": "docs", "section": "Documentation", "hidden": false }, + { "type": "deps", "section": "Dependencies update", "hidden": false }, + { "type": "ci", "section": "CI configuration", "hidden": false }, + { "type": "perf", "section": "Performance improvements", "hidden": false }, + { "type": "build", "section": "Build system", "hidden": false }, + { "type": "style", "section": "Style improvements", "hidden": false }, + { "type": "test", "section": "Test improvements", "hidden": false } + + ] + } + } + ], + "@semantic-release/github" + ] + }' > .releaserc + + - name: Create github release only + uses: cycjimmy/semantic-release-action@v4.1.0 + with: + extra_plugins: | + conventional-changelog-conventionalcommits@6.0.0 + env: + GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}