From f6e24a8b96a6c98175373722d6c77115802ff85c Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:07:42 +0100 Subject: [PATCH] ci: configure automatic release --- .github/workflows/release.yaml | 32 ++++++++++++++++++++++++++++++++ .releaserc | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .releaserc diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..cc83a1f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +name: Generate Semantic Release +on: + push: + branches: + - version-14 + - version-15 + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Entire Repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false # https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md#pushing-packagejson-changes-to-a-master-branch + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + - name: Setup dependencies + run: | + npm install @semantic-release/git @semantic-release/exec --no-save + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + GIT_AUTHOR_NAME: "alyf-linus" + GIT_AUTHOR_EMAIL: "136631072+alyf-linus@users.noreply.github.com" + GIT_COMMITTER_NAME: "alyf-linus" + GIT_COMMITTER_EMAIL: "136631072+alyf-linus@users.noreply.github.com" + run: npx semantic-release diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..5fcf309 --- /dev/null +++ b/.releaserc @@ -0,0 +1,33 @@ +{ + "branches": ["version-14", "version-15"], + "plugins": [ + [ + "@semantic-release/commit-analyzer", { + "releaseRules": [ + {"breaking": true, "release": "minor"}, + {"revert": true, "release": "patch"}, + {"type": "feat", "release": "minor"}, + {"type": "patch", "release": "minor"}, + {"type": "fix", "release": "patch"}, + {"type": "perf", "release": "patch"}, + {"type": "refactor", "release": "patch"}, + {"type": "docs", "release": "patch"}, + {"type": "chore", "release": "patch"} + ] + } + ], + "@semantic-release/release-notes-generator", + [ + "@semantic-release/exec", { + "prepareCmd": 'sed -ir -E "s/\"[0-9]+\.[0-9]+\.[0-9]+\"/\"${nextRelease.version}\"/" erpnext_datev/__init__.py' + } + ], + [ + "@semantic-release/git", { + "assets": ["erpnext_datev/__init__.py"], + "message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}" + } + ], + "@semantic-release/github" + ] +}