-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Tea-n-Tech/feature/poetry
Adding poetry
- Loading branch information
Showing
15 changed files
with
1,992 additions
and
713 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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: | ||
- staging | ||
- "release/*" | ||
- "main" | ||
tags: | ||
- "**" | ||
|
||
|
@@ -13,10 +13,16 @@ defaults: | |
shell: bash | ||
|
||
jobs: | ||
release: | ||
upload: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel previous runs on the same branch | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
|
@@ -56,8 +62,24 @@ jobs: | |
path: dist | ||
if-no-files-found: error | ||
|
||
- name: Test for PyPi Test Secret | ||
id: check_secrets | ||
shell: bash | ||
run: | | ||
unset HAS_TEST_SECRET | ||
if [ -n "$PYPI_TEST_TOKEN" ]; then HAS_TEST_SECRET='true' ; fi | ||
echo ::set-output name=HAS_TEST_SECRET::${HAS_TEST_SECRET} | ||
unset HAS_SECRET | ||
if [ -n "$PYPI_TOKEN" ]; then HAS_SECRET='true' ; fi | ||
echo ::set-output name=HAS_SECRET::${HAS_SECRET} | ||
env: | ||
PYPI_TEST_TOKEN: "${{ secrets.TEST_PYPI_API_TOKEN }}" | ||
PYPI_TOKEN: "${{ secrets.PYPI_API_TOKEN }}" | ||
|
||
- name: Publish package to Test-PyPi | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/staging') | ||
# if: ${{ github.ref != 'refs/heads/staging' }} | ||
if: steps.check_secrets.outputs.HAS_TEST_SECRET | ||
env: | ||
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ | ||
TWINE_USERNAME: __token__ | ||
|
@@ -66,7 +88,8 @@ jobs: | |
run: twine upload --non-interactive --skip-existing --verbose 'dist/*' | ||
|
||
- name: Publish package to PyPi | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
# if: ${{ github.ref != 'refs/heads/main' }} | ||
if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.event.ref, 'refs/tags') | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_NON_INTERACTIVE: 1 | ||
|
Oops, something went wrong.