forked from cython/cython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up uploading non-compiled nightly wheels twice weekly
- Loading branch information
1 parent
cf10ea1
commit 0cd62a3
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Workflow to build non-compiled nightly wheel. | ||
|
||
name: Nightly wheels | ||
on: | ||
schedule: | ||
# ┌───────────── minute (0 - 59) | ||
# │ ┌───────────── hour (0 - 23) | ||
# │ │ ┌───────────── day of the month (1 - 31) | ||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | ||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | ||
# │ │ │ │ │ | ||
- cron: "42 1 * * 0,3" | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened] | ||
paths: | ||
#- Cython/Build/** | ||
- .github/workflows/nightly-wheels.yml | ||
- pyproject.toml | ||
- MANIFEST.in | ||
- setup.* | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
build_pure_wheel: | ||
name: Build pure wheel and upload to Anaconda's PyPI | ||
if: >- | ||
github.event_name == 'schedule' || | ||
github.event_name == 'workflow_dispatch' || | ||
(github.event_name == 'pull_request' && | ||
contains(github.event.pull_request.labels.*.name, 'Build System')) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Cython | ||
uses: actions/[email protected] | ||
|
||
- uses: deadsnakes/[email protected] | ||
with: | ||
python-version: 3.13-dev | ||
nogil: true | ||
|
||
- name: Build pure wheel | ||
run: | | ||
pip install --upgrade wheel setuptools | ||
python setup.py bdist_wheel --no-cython-compile | ||
- uses: actions/[email protected] | ||
with: | ||
name: pure-wheel | ||
path: ./dist/*.whl | ||
|
||
- uses: conda-incubator/[email protected] | ||
with: | ||
# for installation of anaconda-client, required for upload to | ||
# anaconda.org | ||
# default (and activated) environment name is test | ||
# Note that this step is *after* specific pythons have been used to | ||
# build | ||
auto-update-conda: true | ||
python-version: "3.10" | ||
|
||
- name: Upload wheels to scientific-python-nightly-wheels | ||
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | ||
shell: bash -el {0} | ||
# see https://github.com/marketplace/actions/setup-miniconda for why | ||
# `-el {0}` is required. | ||
env: | ||
TOKEN: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }} | ||
run: | | ||
source Tools/upload-wheels.sh | ||
# trigger an upload to | ||
# https://anaconda.org/scientific-python-nightly-wheels/numpy | ||
# for cron jobs or "Run workflow" (restricted to main branch). | ||
# The tokens were originally generated at anaconda.org | ||
upload_wheels |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
upload_wheels() { | ||
echo ${PWD} | ||
if [[ -z ${TOKEN} ]]; then | ||
echo no token set, not uploading | ||
else | ||
if compgen -G "./dist/*.whl"; then | ||
echo "Found wheel" | ||
anaconda -q -t ${TOKEN} upload --force -u scientific-python-nightly-wheels ./dist/*.whl | ||
echo "PyPI-style index: https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" | ||
else | ||
echo "Files do not exist" | ||
return 1 | ||
fi | ||
fi | ||
} |