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

Revise pip.yml to produce true nightlies #7397

Closed
wants to merge 3 commits into from
Closed
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
37 changes: 27 additions & 10 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@
name: Build PyPI package

on:
push:
branches: [ main ]
release:
types: [ created ]
# In the main working branch of Halide, this Action is configured to produce nightly
# builds (whether or not new commits have occurred.)
#
# TODO: Currently this uses the most-recentversion of LLVM that we have built
# in Halide/docker-images, which does not correspond to top-of-tree LLVM, which
# is what we really want for nightlies. We should consider whether there is a
# way to efficiently produce nightly LLVM builds to allow nightly Halide drops that
# reflect the right branch of LLVM.

# In Release branches, this file should be edited to make official releases. See:
# https://setuptools.pypa.io/en/latest/userguide/distribution.html#making-official-non-snapshot-releases
#
# TODO: edit this file so that the appropriate changes for a Release branch are obvious (but commented out).
#
# push:
# branches: [ main ]
# release:
# types: [ created ]

schedule:
# Run at 4:15AM UTC every day, which is 8:15PM PST
- cron: '15 4 * * *'

concurrency:
group: '${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
Expand All @@ -23,16 +41,15 @@ permissions:

jobs:
# When creating 'dev' (e.g. nightly) PyPI packages, we need to create a unique
# label for each upload. For simplicity, we choose the Unix time-since-epoch in
# UTC form (aka `date +%s`).
# eigh-character label for each upload, so we'll use yyyymmdd.
pip-labels:
name: Create Label for PyPI Packages
runs-on: ubuntu-latest
outputs:
halide_pypi_label: ${{ steps.make_label.outputs.unix_time_utc }}
halide_pypi_label: ${{ steps.make_label.outputs.yyyymmdd }}
steps:
- id: make_label
run: echo "unix_time_utc=$(date +%s)" >> "$GITHUB_OUTPUT"
run: echo "yyyymmdd=$(date +%Y%m%d)" >> "$GITHUB_OUTPUT"

pip-linux:
name: Package Halide Python bindings
Expand Down Expand Up @@ -219,13 +236,13 @@ jobs:
name: wheels
path: dist

- uses: pypa/gh-action-pypi-publish@v1.5.1
- uses: pypa/gh-action-pypi-publish@v1.6.4
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- uses: pypa/gh-action-pypi-publish@v1.5.1
- uses: pypa/gh-action-pypi-publish@v1.6.4
if: github.event_name == 'release' && github.event.action == 'published'
with:
user: __token__
Expand Down