-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We will use github actions for release
- Loading branch information
Showing
1 changed file
with
31 additions
and
2 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,15 +1,15 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python package | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ dev ] | ||
|
||
jobs: | ||
build: | ||
ci: | ||
env: | ||
# Fake a TRAVIS env so that the pre-existing test cases would behave like before | ||
TRAVIS: true | ||
|
@@ -19,6 +19,7 @@ jobs: | |
LAB_OBO_CONFIDENTIAL_CLIENT_ID: ${{ secrets.LAB_OBO_CONFIDENTIAL_CLIENT_ID }} | ||
LAB_OBO_PUBLIC_CLIENT_ID: ${{ secrets.LAB_OBO_PUBLIC_CLIENT_ID }} | ||
|
||
# Derived from https://docs.github.com/en/actions/guides/building-and-testing-python#starting-with-the-python-workflow-template | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -58,3 +59,31 @@ jobs: | |
- name: Test with pytest | ||
run: | | ||
pytest | ||
cd: | ||
needs: ci | ||
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Build a package for release | ||
run: | | ||
python -m pip install build --user | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- name: Publish to TestPyPI | ||
uses: pypa/[email protected] | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |