Skip to content

Commit 5dfcd09

Browse files
fix: changed release workflow completely (#882)
* 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>
1 parent 5e94b4f commit 5dfcd09

4 files changed

Lines changed: 60 additions & 12 deletions

File tree

.github/workflows/monthly_release.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@ on:
1212
jobs:
1313
release:
1414
runs-on: ubuntu-latest
15-
15+
env:
16+
BRANCH_NAME: new-release-${{ github.run_id }}
1617
steps:
1718
- uses: actions/setup-python@v2
1819
with:
1920
python-version: 3.6
20-
- name: Checkout code
21+
- name: Checkout master
2122
uses: actions/checkout@v2
2223
with:
2324
fetch-depth: "0"
24-
- name: Semantic Release
25-
uses: relekang/python-semantic-release@master
26-
with:
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
pypi_username: __token__
29-
pypi_password: ${{ secrets.pypi_password }}
30-
25+
- name: Create new branch
26+
run: |
27+
git checkout -b ${{ env.BRANCH_NAME }}
28+
- name: Semantic release
29+
run: |
30+
pip install python-semantic-release
31+
git config user.name github-actions
32+
git config user.email github-actions@github.com
33+
semantic-release version -D branch=${{ env.BRANCH_NAME }}
34+
semantic-release changelog
3135
- name: Create release pull request
3236
uses: peter-evans/create-pull-request@v3
3337
with:
@@ -40,4 +44,7 @@ jobs:
4044
Auto-generated by [create-pull-request][1]
4145
4246
[1]: https://github.com/peter-evans/create-pull-request
43-
branch: new-release
47+
branch: env.BRANCH_NAME
48+
base: master
49+
delete-branch: true
50+
signoff: true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
- name: Setup python 3.6
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.6
20+
- name: Get version
21+
id: vers
22+
run: |
23+
pip install python-semantic-release
24+
echo ::set-output name=version::$(semantic-release print-version --current)
25+
- name: Create release
26+
id: create_release
27+
uses: actions/create-release@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
tag_name: ${{ steps.vers.outputs.version }}
32+
release_name: New features & Bug Fixes
33+
- name: Add wheel dependency
34+
run: pip install wheel
35+
- name: Generate dist
36+
run: python setup.py sdist bdist_wheel
37+
- name: Publish to PyPI
38+
uses: pypa/gh-action-pypi-publish@master
39+
with:
40+
user: __token__
41+
password: ${{ secrets.pypi_password }}

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ warn_no_return = True
2929

3030
[semantic_release]
3131
version_variable = "./setup.py:__version__"
32-
branch = new-release
3332
upload_to_pypi = true
3433
upload_to_release = true
34+
commit_subject = "New release for {version}"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def build_js() -> None:
3737
with open(requirements_path) as requirements_file:
3838
requirements = requirements_file.readlines()
3939

40-
__version__ = '3.2.0'
40+
__version__ = '3.3.0'
4141

4242

4343
setup(

0 commit comments

Comments
 (0)