Skip to content

Commit

Permalink
Add manual deploy (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-ls authored Mar 16, 2022
1 parent da0e459 commit a243783
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ jobs:
- name: Run code quality
uses: olxbr/code-quality-action@v1

build-and-publish:
build-and-publish-dev:
if: startsWith( github.ref, 'refs/tags/' )
needs: [quality]
runs-on: ubuntu-latest
environment: 'dev'

steps:
- name: Checkout repository
Expand All @@ -60,6 +61,36 @@ jobs:
RELEASE_VERSION: ${{ steps.release.outputs.version }}
run: python3 -m build -s

- name: Publish artifact
uses: actions/upload-artifact@v2
with:
name: barterdude-{{ steps.release.outputs.version }}.tar.gz
path: './dist/barterdude-{{ steps.release.outputs.version }}.tar.gz'

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

publish-prod:
if: startsWith( github.ref, 'refs/tags/' )
needs: [quality, build-and-publish-dev]
runs-on: ubuntu-latest
environment: 'prod'

steps:
- name: Choose tag or commit as version
id: release
uses: olxbr/[email protected]

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: barterdude-{{ steps.release.outputs.version }}.tar.gz
path: './dist/barterdude-{{ steps.release.outputs.version }}.tar.gz'

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit a243783

Please sign in to comment.