Skip to content

Commit

Permalink
fix: changed release workflow completely (#882)
Browse files Browse the repository at this point in the history
* added PR creation to release action

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* set new branch rather than master

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* changed cron to 12:15pm

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* chnaged release aciton branch and added manual run trigger

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* eventually I'll get this right...

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* another one

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* one more branch change

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* trying to get the branch there so it can be checked out

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* added pypy credentials

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* chaged to uses/with

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* bumped version on setup.py file

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* added pypi user and pass

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* setting base branch to be master

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* delete branch after pr closed

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* trying a different more granular approach, pypi should be triggered once PR with new version is merged

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* publishes new release

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* fixed

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>

* hoping this works, will add changelog next if it does

Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>
  • Loading branch information
allisonsuarez authored Jan 28, 2021
1 parent 5e94b4f commit 5dfcd09
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 12 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/monthly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,26 @@ on:
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 code
- name: Checkout master
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_username: __token__
pypi_password: ${{ secrets.pypi_password }}

- name: Create new branch
run: |
git checkout -b ${{ env.BRANCH_NAME }}
- name: Semantic release
run: |
pip install python-semantic-release
git config user.name github-actions
git config user.email github-actions@github.com
semantic-release version -D branch=${{ env.BRANCH_NAME }}
semantic-release changelog
- name: Create release pull request
uses: peter-evans/create-pull-request@v3
with:
Expand All @@ -40,4 +44,7 @@ jobs:
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
branch: new-release
branch: env.BRANCH_NAME
base: master
delete-branch: true
signoff: true
41 changes: 41 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Monthly Release

on:
push:
branches:
- master
paths:
# triggered when version is bumped
- "setup.py"
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
- 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 }}
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ warn_no_return = True

[semantic_release]
version_variable = "./setup.py:__version__"
branch = new-release
upload_to_pypi = true
upload_to_release = true
commit_subject = "New release for {version}"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def build_js() -> None:
with open(requirements_path) as requirements_file:
requirements = requirements_file.readlines()

__version__ = '3.2.0'
__version__ = '3.3.0'


setup(
Expand Down

0 comments on commit 5dfcd09

Please sign in to comment.