Skip to content

Commit c30ee6d

Browse files
chore: addded release to automate releases (#255)
Signed-off-by: Allison Suarez Miranda <[email protected]>
1 parent 1e2e3c8 commit c30ee6d

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

Diff for: .github/workflows/monthly_release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Monthly Release
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 1 * *
6+
workflow_dispatch:
7+
logLevel:
8+
description: "Log level"
9+
required: true
10+
default: "warning"
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
env:
16+
BRANCH_NAME: new-release-${{ github.run_id }}
17+
steps:
18+
- uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.6
21+
- name: Checkout master
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: "0"
25+
- name: Semantic release
26+
id: semantic-release
27+
run: |
28+
pip install python-semantic-release
29+
git config user.name github-actions
30+
git config user.email [email protected]
31+
semantic-release version
32+
echo ::set-output name=version::$(semantic-release print-version --current)
33+
semantic-release changelog > './CHANGELOG.md'
34+
- name: Create release pull request
35+
uses: peter-evans/create-pull-request@v3
36+
with:
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
commit-message: Bumped version to ${{ steps.semantic-release.outputs.version }}
39+
committer: github-actions <[email protected]>
40+
author: github-actions <[email protected]>
41+
signoff: true
42+
branch: ${{ env.BRANCH_NAME }}
43+
delete-branch: true
44+
title: |
45+
chore: Bumped version for release ${{ steps.semantic-release.outputs.version }}
46+
body: |
47+
Bumped version to ${{ steps.semantic-release.outputs.version }}
48+
team-reviewers: amundsen-io/amundsen-committers

Diff for: .github/workflows/publish_release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Monthly Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
# triggered when version is bumped
9+
- "setup.py"
10+
- "CHANGELOG.md"
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
- name: Setup python 3.6
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.6
21+
- name: Get version
22+
id: vers
23+
run: |
24+
pip install python-semantic-release
25+
echo ::set-output name=version::$(semantic-release print-version --current)
26+
- name: Create release
27+
id: create_release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ steps.vers.outputs.version }}
33+
release_name: New Features & Bug Fixes
34+
body_path: ./CHANGELOG.md
35+
- name: Add wheel dependency
36+
run: pip install wheel
37+
- name: Generate dist
38+
run: python setup.py sdist bdist_wheel
39+
- name: Publish to PyPI
40+
uses: pypa/gh-action-pypi-publish@master
41+
with:
42+
user: __token__
43+
password: ${{ secrets.pypi_password }}

Diff for: setup.cfg

+8
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ disallow_untyped_defs = True
3737
ignore_missing_imports = True
3838
strict_optional = True
3939
warn_no_return = True
40+
41+
[semantic_release]
42+
version_variable = "./setup.py:__version__"
43+
upload_to_pypi = true
44+
upload_to_release = true
45+
commit_subject = New release for {version}
46+
commit_message = Signed-off-by: github-actions <[email protected]>
47+
commit_author = github-actions <[email protected]>

0 commit comments

Comments
 (0)