Skip to content

Commit

Permalink
Add release workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseefeld committed Feb 7, 2021
1 parent a046a71 commit 0f369a8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish release

on:
push:
tags:
- 'release/*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
uses: actions/setup-python@v2
- name: build
run: |
python -c "import versioneer as V; print(f'version={V.get_version()}')" >> $GITHUB_ENV
python setup.py sdist
- name: release snapshot on github
if: contains(github.ref, 'dev')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.version }}
draft: false
prerelease: true
- name: publish snapshot to Test PyPI
if: contains(github.ref, 'dev')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: release on github
if: ${{ !contains(github.ref, 'dev') }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.version }}
draft: false
prerelease: false
- name: publish release package to PyPI
if: ${{ !contains(github.ref, 'dev') }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 0f369a8

Please sign in to comment.