Skip to content

Commit

Permalink
global: fix gh actions to release on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Oct 13, 2021
1 parent 8296cbb commit 3ed869d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ name: Build and release
on:
push:
branches: [master]
tags:
- "*"
pull_request:
branches: [master]
release:
types: [published]

jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.6]

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -41,12 +40,12 @@ jobs:
./run-tests.sh
- name: Build package
if: ${{ success() && github.event_name == 'push' && matrix.python-version == '3.6' }}
if: ${{ success() && github.event_name == 'release' && matrix.python-version == '3.6' }}
run: |
python setup.py sdist bdist_wheel
- name: Publish package
if: ${{ success() && github.event_name == 'push' && matrix.python-version == '3.6' }}
if: ${{ success() && github.event_name == 'release' && matrix.python-version == '3.6' }}
uses: pypa/gh-action-pypi-publish@v1.3.1
with:
user: __token__
Expand Down

0 comments on commit 3ed869d

Please sign in to comment.