Skip to content

Bring clvm_serde from richardkiss/hsms #60

Bring clvm_serde from richardkiss/hsms

Bring clvm_serde from richardkiss/hsms #60

Workflow file for this run

# The wheel here isn't platform specific, so can build on linux and it works anywhere
name: Build Wheel
on:
push:
branches:
- main
tags:
- '**'
pull_request:
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
jobs:
build-wheels:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_24_x86_64
steps:
- name: Add safe git directory
uses: Chia-Network/actions/git-mark-workspace-safe@main
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create venv
run: /opt/python/cp38-cp38/bin/python3 -m venv venv
- name: Create Wheel
run: |
. ./venv/bin/activate
pip wheel -w dist --no-deps .
- name: Create source dist
run: |
. ./venv/bin/activate
pip install build
python -m build --sdist --outdir dist .
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./dist
- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo "HAS_SECRET=${HAS_SECRET}" >>$GITHUB_OUTPUT
env:
SECRET: "${{ secrets.test_pypi_password }}"
- name: Install twine
run: |
. ./venv/bin/activate
pip install twine
- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
. ./venv/bin/activate
twine upload --non-interactive --skip-existing --verbose 'dist/*'
- name: Publish distribution to Test PyPI
if: steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
. ./venv/bin/activate
twine upload --non-interactive --skip-existing --verbose 'dist/*'