2
0
mirror of https://github.com/frappe/bench.git synced 2024-10-02 00:39:04 +00:00

chore: Add Semantic Release

This commit is contained in:
hasnain2808@gmail.com 2021-02-03 10:21:40 +05:30
parent f43ff04809
commit 0b925a3838
2 changed files with 53 additions and 0 deletions

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

@ -0,0 +1,28 @@
name: Release
on:
push:
branches:
- v5.x
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set-up semantic-release plugins
run: npm install @semantic-release/git @semantic-release/exec --no-save
- name: Set-up python build env
run: pip install wheel twine
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
TEST_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
run: npx semantic-release

25
.releaserc Normal file
View File

@ -0,0 +1,25 @@
{
"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 -r testpypi dist/* -u $TEST_PYPI_USERNAME -p $TEST_PYPI_PASSWORD"
}]
]
}