2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

Merge pull request #1110 from hasnain2808/semantic-release-bench

chore: Add Semantic Release
This commit is contained in:
gavin 2021-02-04 13:27:27 +05:30 committed by GitHub
commit 64d755691e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 0 deletions

28
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Generate Semantic Release and publish on PyPI
on:
push:
branches:
- v5.x
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout Entire Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
pip install wheel twine
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
run: npx semantic-release

35
.releaserc Normal file
View File

@ -0,0 +1,35 @@
{
"branches": ["v5.x"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" bench/__init__.py'
}
],
[
"@semantic-release/exec", {
"prepareCmd": "python setup.py bdist_wheel --universal"
}
],
[
"@semantic-release/git", {
"assets": ["bench/__init__.py"],
"message": "chore(release): Bumped to Version ${nextRelease.version}\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github", {
"assets": [
{"path": "dist/*"},
]
}
],
[
"@semantic-release/exec", {
"publishCmd": "python -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD"
}
]
]
}