Deploy #21
Workflow file for this run
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
name: Deploy | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
retrieve_artifacts: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
steps: | |
- name: Retrieve wheel artifacts for release | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
# name: ${{ github.event.release.name }}-wheels | |
repo: ${{ github.repository }} | |
workflow: build.yml | |
path: ./dist | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Retrieve SDIST artifacts for release | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
name: ${{ github.event.release.name }}-sdist | |
repo: ${{ github.repository }} | |
workflow: build.yml | |
path: ./dist | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# Test step for debugging | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: ./dist | |
- name: Move contents of directories to root of dist | |
run: | | |
mv -f ./dist/${{ github.event.release.name }}-wheels/* ./dist | |
rm -rf ./dist/${{ github.event.release.name }}-wheels | |
mv -f ./dist/${{ github.event.release.name }}-sdist/* ./dist | |
rm -rf ./dist/${{ github.event.release.name }}-sdist | |
working-directory: ./dist | |
# Test step for debugging | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: ./dist | |
- name: Release code as new release on Pypi | |
if: ${{ startsWith(github.event.release.name,'v') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
repository-url: https://PREVENTFORTESTING.upload.pypi.org/legacy/ | |
verbose: true | |
- name: "TEST: Release code as new release on Test Pypi" | |
if: ${{ startsWith(github.event.release.name,'test-') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TEST_PASSWORD }} | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true |