Skip to content

Publish Wheel Package #19

Publish Wheel Package

Publish Wheel Package #19

Workflow file for this run

---
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@v4
with:
fetch-tags: true
- name: Run go release to create binaries
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --clean
- name: Install Python
uses: actions/setup-python@v5
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 != '') }}