Skip to content

Commit

Permalink
ci(release): Tweak GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
wichert committed Mar 25, 2020
1 parent 92b3c6a commit c167db7
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/main.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build and publish Python 🐍 distributions

on: push
on:
push:
tags:
- '*'

jobs:
build-n-publish:
Expand All @@ -15,14 +18,19 @@ jobs:
with:
python-version: 3.7

- name: Install wheel
run: python -m pip install wheel --user

- name: Insert version number
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
version=$(echo $GITHUB_REF | cut -d/ -f3)
sed -ie "/^version/s/=.*/= \"$version\"/" setup.py
- name: Install wheel
run: python -m pip install wheel --user
- name: Generate changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
env:
REPO: ${{ github.repository }}

- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
Expand All @@ -33,3 +41,17 @@ jobs:
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false

0 comments on commit c167db7

Please sign in to comment.