-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
125adcb
commit 76dc3eb
Showing
1 changed file
with
25 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,31 @@ | ||
name: Build distribution | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming | ||
# Existing codes likely still have "master" as the primary branch | ||
# Both are tracked here to keep legacy and new codes working | ||
push: | ||
branches: | ||
- "demo" | ||
schedule: | ||
# Nightly tests run on master by default: | ||
# Scheduled workflows run on the latest commit on the default or base branch. | ||
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) | ||
- cron: "0 0 * * 1" ## running every Monday at midnight | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
test: | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
deploy: | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
runs-on: ubuntu-latest | ||
|
||
- name: Install build dependencies | ||
run: python -m pip install build wheel | ||
|
||
- name: Build distributions | ||
shell: bash -l {0} | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish package to PyPI | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') #github.repository == 'ProLint/ufcc' && | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.pypi_password }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |