Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enabling pre-release logic CI #361

Merged
merged 3 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
330 changes: 171 additions & 159 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: build - check - upload
on:
push:
branches:
- 'main'
tags:
- '**'
- main
release:
types: [published]
pull_request:
branches:
- '**'
Expand All @@ -19,6 +19,7 @@ jobs:
build-wheels:
name: Wheel - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -112,6 +113,12 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
if: env.RUNNER_ARCH != 'ARM64'
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
Expand Down Expand Up @@ -202,159 +209,164 @@ jobs:
name: packages
path: ./dist

# build-sdist:
# name: sdist - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
# runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - name: Ubuntu
# matrix: ubuntu
# runs-on:
# arm: [Linux, ARM64]
# intel: [ubuntu-latest]
# python:
# - major-dot-minor: '3.9'
# matrix: '3.9'
# arch:
# - name: Intel
# matrix: intel

# steps:
# - name: Clean workspace
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0

# - uses: Chia-Network/actions/setup-python@main
# with:
# python-version: ${{ matrix.python.major-dot-minor }}

# - name: Build source distribution
# run: |
# pip install build
# python -m build --sdist --outdir dist .

# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: packages
# path: ./dist

# check:
# name: Check - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
# runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - name: Ubuntu
# matrix: ubuntu
# runs-on:
# arm: [Linux, ARM64]
# intel: [ubuntu-latest]
# python:
# - major-dot-minor: '3.9'
# matrix: '3.9'
# arch:
# - name: Intel
# matrix: intel

# steps:
# - name: Clean workspace
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0

# - uses: Chia-Network/actions/setup-python@main
# with:
# python-version: ${{ matrix.python.major-dot-minor }}

# - name: flake8
# run: |
# pip install flake8
# flake8 tests setup.py

# - name: mypy
# run: |
# pip install mypy
# mypy --config-file mypi.ini setup.py tests

# upload:
# name: Upload to PyPI - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
# runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
# needs:
# - build-wheels
# - build-sdist
# - check
# strategy:
# fail-fast: false
# matrix:
# os:
# - name: Ubuntu
# matrix: ubuntu
# runs-on:
# arm: [Linux, ARM64]
# intel: [ubuntu-latest]
# python:
# - major-dot-minor: '3.9'
# matrix: '3.9'
# arch:
# - name: Intel
# matrix: intel

# steps:
# - name: Clean workspace
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0

# - uses: Chia-Network/actions/setup-python@main
# with:
# python-version: ${{ matrix.python.major-dot-minor }}

# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: packages
# 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: 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: 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: twine upload --non-interactive --skip-existing --verbose 'dist/*'
build-sdist:
name: sdist - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
python:
- major-dot-minor: '3.9'
matrix: '3.9'
arch:
- name: Intel
matrix: intel

steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}

- name: Build source distribution
run: |
pip install build
python -m build --sdist --outdir dist .

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: ./dist

check:
name: Check - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
python:
- major-dot-minor: '3.9'
matrix: '3.9'
arch:
- name: Intel
matrix: intel

steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}

- name: flake8
run: |
pip install flake8
flake8 tests setup.py

- name: mypy
run: |
pip install mypy
mypy --config-file mypi.ini setup.py tests

upload:
name: Upload to PyPI - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
needs:
- build-wheels
- build-sdist
- check
strategy:
fail-fast: false
matrix:
os:
- name: Ubuntu
matrix: ubuntu
runs-on:
arm: [Linux, ARM64]
intel: [ubuntu-latest]
python:
- major-dot-minor: '3.9'
matrix: '3.9'
arch:
- name: Intel
matrix: intel

steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: packages
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: pip install twine

- name: Publish distribution to PyPI
if: env.RELEASE == 'true' && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'

- name: Publish distribution to Test PyPI
if: env.PRE_RELEASE == 'true' && 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: twine upload --non-interactive --skip-existing --verbose 'dist/*'
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,11 @@ def build_extensions(self):
ext.extra_link_args = link_opts
build_ext.build_extensions(self)

# Copy bladebit_harvester.dll on windows to the target build directory
# Copy bladebit_harvester.dll on windows to the target build directory
# in order to package it into the root directory of the wheel
if os.getenv("CP_USE_GREEN_REAPER") == "1" and sys.platform == "win32":
shutil.copy2("libs/bladebit_harvester.dll", self.build_lib + "/bladebit_harvester.dll")




if platform.system() == "Windows":
setup(
Expand Down
Loading