-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GH Action GitHub + PyPI release automation on git version tag pushes #265
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ce46612
add GH Action GitHub + PyPI release automation on git version tag pushes
chrissimpkins 799c462
Use the annotated tag message for release body
m4rc1e 0be67c4
release: remove linebreak formats
m4rc1e c5342e9
release: output annotated tag message in markdown
m4rc1e c0890d1
cleanup and add comments
m4rc1e 3164649
Implement Nikolaus feedback
m4rc1e ddbef46
repin to v1
m4rc1e 12acc22
use tempfile
m4rc1e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
on: | ||
push: | ||
tags: | ||
- "v*" # Push events to matching `v*` version srings. e.g. v1.0, v20.15.10 | ||
|
||
name: Create and Publish Release | ||
|
||
jobs: | ||
build: | ||
name: Create and Publish Release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install release dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel twine | ||
- name: Get release notes | ||
id: release_notes | ||
run: | | ||
CHANGELOG=$(git tag -l --format='%(contents)' ${{ github.ref }}) | ||
echo "::set-output name=changelog::$CHANGELOG" | ||
- name: Create GitHub release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: ${{ steps.release_notes.outputs.changelog }} | ||
draft: false | ||
prerelease: false | ||
- name: Build and publish to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
m4rc1e marked this conversation as resolved.
Show resolved
Hide resolved
|
||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably get rid of
matrix
and just usepython-version: "3.x"
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep definitely. sorry this was copy/pasted from blocks of my ci templates. ty!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m4rc1e Please let me know if you want this change and want me to make the edit.