Skip to content

Commit

Permalink
Adds publish-package.yml workflow to publish a new package (#8)
Browse files Browse the repository at this point in the history
* Adds publish-package.yml workflow to publish a new package
  • Loading branch information
Hirotaka Wakabayashi authored Dec 2, 2020
1 parent d9ba53e commit dbd0805
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 12 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
# Trigger the workflow on release,
# but only when published
release:
types:
- published

jobs:
build:

if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]') && ! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']

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 dependencies
run: |
make init
- name: Lint with flake8, mypy, pylint and checkdocs
run: |
# stop the build if there are Python syntax errors or undefined names
make lint
- name: Run tests
run: |
make test
- name: Check coverage
run: |
make coverage
- name: Make docs
run: |
make docs
- name: Make dist package
run: |
make dist
- name: Install the package locally
run: |
make install
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.event_name == 'release'
run: |
make release
12 changes: 0 additions & 12 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
branches: [ master ]
schedule:
- cron: '0 0 * * 1'
# Trigger the workflow on release,
# but only when published
release:
types:
- published

jobs:
build:
Expand Down Expand Up @@ -52,10 +47,3 @@ jobs:
- name: Install the package locally
run: |
make install
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: github.event_name == 'release'
run: |
make release

0 comments on commit dbd0805

Please sign in to comment.