Release #28
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: Upload Python Package | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# step used to set up python, install poetry and to create | |
# to virtual environment described in poetry.lock | |
- uses: cvxgrp/.github/actions/setup-environment@main | |
# change the version in pyproject.toml and build the package | |
- name: Change version in pyproject.toml | |
shell: bash | |
run: | | |
poetry version ${{ github.ref_name }} | |
poetry build | |
# Archive the dist folder | |
- name: Archive sphinx documentation | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
retention-days: 1 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: release | |
permissions: | |
# This permission is required for trusted publishing. | |
id-token: write | |
steps: | |
#- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
# Download the dist folder from the build job | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
#path: dist | |
# Generate the token | |
- name: Mint token | |
id: mint | |
uses: tschm/token-mint-action@v1.0.2 | |
# Install twine and upload the dist folder using the token | |
- name: Publish the package | |
shell: bash | |
run: | | |
ls -l dist | |
pip install twine | |
twine upload --verbose -u __token__ -p '${{ steps.mint.outputs.api-token }}' dist/* |