Skip to content

Commit

Permalink
ci: configure automatic release
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Mar 13, 2024
1 parent c28c77a commit f6e24a8
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
GIT_COMMITTER_NAME: "alyf-linus"
GIT_COMMITTER_EMAIL: "[email protected]"
run: npx semantic-release
33 changes: 33 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit f6e24a8

Please sign in to comment.