Skip to content

Commit

Permalink
Merge pull request #19 from lixun910/master
Browse files Browse the repository at this point in the history
Update GitHub Action for release
  • Loading branch information
lixun910 authored Sep 9, 2021
2 parents 6b8a1a0 + 2a7c7a3 commit 32ee531
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
name: Ubuntu and Mac builds

on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]

jobs:

build_and_publish:
strategy:
matrix:
Expand Down Expand Up @@ -46,15 +38,16 @@ jobs:
path: wheelhouse/

- name: Publish to Pypi
if: github.event_name == 'release' && github.event.action == 'created'
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade twine
python3 -m twine upload wheelhouse/*.whl
- name: Publish Source to Pypi
if: matrix.os == 'macos-latest' && github.event_name == 'release' && github.event.action == 'created'
if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/win-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@

name: Windows builds

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]

jobs:
windows_build:
Expand Down Expand Up @@ -87,9 +78,10 @@ jobs:
path: wheelhouse/

- name: Publish to Pypi
if: github.event_name == 'release' && github.event.action == 'created'
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install --upgrade twine
python -m twine upload wheelhouse/*.whl

0 comments on commit 32ee531

Please sign in to comment.