Publish Wheel Package #7
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: Publish Wheel Package | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [goreleaser] | |
types: | |
- completed | |
jobs: | |
publish_whl: | |
name: Publish Wheel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-tags: true | |
- name: Run go release to create binaries | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: build --clean | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install Twine | |
run: python -m pip install twine | |
- name: Pack WHEEL Package | |
working-directory: ./bdist/py | |
run: python3 setup.py | |
- name: Check WHEEL Packages | |
working-directory: ./bdist/py | |
run: twine check _wheel/* | |
- name: Issue warning if TWINE_USERNAME and TWINE_PASSWORD are not set | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} | |
run: | | |
echo -n "::warning title=Missing authentication token::In order to publish an wheel package, you must set " | |
echo "the PYPI_USERNAME and PYPI_AUTH_TOKEN secrets" | |
if: ${{ (env.TWINE_USERNAME == '') || (env.TWINE_PASSWORD == '') }} | |
- name: Publish WHEEL package | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} | |
run: twine upload _wheel/* | |
working-directory: ./bdist/py | |
if: ${{ (env.TWINE_USERNAME != '') && (env.TWINE_PASSWORD != '') }} |