Skip to content

Commit

Permalink
chore: Automate releases (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Sahithi Velma <[email protected]>

Co-authored-by: Sahithi Velma <[email protected]>
  • Loading branch information
sahithi03 and Sahithi Velma authored Mar 5, 2021
1 parent 2304c79 commit 86437a7
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/monthly_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Monthly Release

on:
schedule:
- cron: 0 0 1 * *
workflow_dispatch:
logLevel:
description: "Log level"
required: true
default: "warning"

jobs:
release:
runs-on: ubuntu-latest
env:
BRANCH_NAME: new-release-${{ github.run_id }}
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Checkout master
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Semantic release
id: semantic-release
run: |
pip install python-semantic-release
git config user.name github-actions
git config user.email [email protected]
semantic-release version
echo ::set-output name=version::$(semantic-release print-version --current)
semantic-release changelog > './CHANGELOG.md'
- name: Create release pull request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Bumped version to ${{ steps.semantic-release.outputs.version }}
committer: github-actions <[email protected]>
author: github-actions <[email protected]>
signoff: true
branch: ${{ env.BRANCH_NAME }}
delete-branch: true
title: |
chore: Bumped version for release ${{ steps.semantic-release.outputs.version }}
body: |
Bumped version to ${{ steps.semantic-release.outputs.version }}
team-reviewers: amundsen-io/amundsen-committers
43 changes: 43 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Monthly Release

on:
push:
branches:
- master
paths:
# triggered when version is bumped
- "setup.py"
- "CHANGELOG.md"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Get version
id: vers
run: |
pip install python-semantic-release
echo ::set-output name=version::$(semantic-release print-version --current)
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.vers.outputs.version }}
release_name: New Features & Bug Fixes
body_path: ./CHANGELOG.md
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ ignore_missing_imports = True
[isort]
multi_line_output=5
skip=venv

[semantic_release]
version_variable = "./setup.py:__version__"
upload_to_pypi = true
upload_to_release = true
commit_subject = New release for {version}
commit_message = Signed-off-by: github-actions <[email protected]>
commit_author = github-actions <[email protected]>

0 comments on commit 86437a7

Please sign in to comment.