Skip to content

Commit dbd036d

Browse files
chore/GHA release flow (#16)
* Adding PR template * Copy release-drafter over from replit-py * Adding a python-publish GHA workflow
1 parent f601618 commit dbd036d

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Why
2+
===
3+
4+
_Describe what prompted you to make this change, link relevant resources_
5+
6+
What changed
7+
============
8+
9+
_Describe what changed to a level of detail that someone with no context with your PR could be able to review it_
10+
11+
Test plan
12+
=========
13+
14+
_Describe what you did to test this change to a level of detail that allows your reviewer to test it_
15+
16+
Rollout
17+
=======
18+
19+
_Describe any procedures or requirements needed to roll this out safely (or check the box below)_
20+
21+
- [ ] This is fully backward and forward compatible

.github/release-drafter.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'feature'
7+
- 'enhancement'
8+
- title: '🐛 Bug Fixes'
9+
labels:
10+
- 'fix'
11+
- 'bugfix'
12+
- 'bug'
13+
- title: '🧰 Maintenance'
14+
label: 'chore'
15+
- title: '🤖 Dependencies'
16+
label: 'dependencies'
17+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
18+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
19+
version-resolver:
20+
major:
21+
labels:
22+
- 'major'
23+
minor:
24+
labels:
25+
- 'minor'
26+
patch:
27+
labels:
28+
- 'patch'
29+
default: patch
30+
template: |
31+
## Changes
32+
33+
$CHANGES

.github/workflows/python-publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install --upgrade poetry
27+
28+
- name: Set release version
29+
run: |
30+
tag="${GITHUB_REF_NAME}"
31+
version="${tag#v}" # Strip leading v
32+
33+
# Bump poetry tag
34+
poetry version "$version"
35+
36+
- name: Build and publish
37+
run: |
38+
TWINE_USERNAME=__token__ \
39+
TWINE_PASSWORD="${{ secrets.PYPI_TOKEN }}" \
40+
make release

0 commit comments

Comments
 (0)