-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
108 additions
and
95 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 |
---|---|---|
|
@@ -34,9 +34,12 @@ jobs: | |
matrix: | ||
os: [ubuntu, macos, windows] | ||
compile_arch: [x86_64, aarch64] | ||
lts: [0, 1] # LongTerm Support CPUs | ||
exclude: | ||
- os: windows | ||
compile_arch: aarch64 | ||
- lts: 1 | ||
compile_arch: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -47,16 +50,24 @@ jobs: | |
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
- run: pip install uv | ||
- run: uv pip install twine toml | ||
- run: uv pip install twine toml yq | ||
- run: python tools/patch_package_version.py | ||
- name: Patch name is LTS | ||
if: ${{ matrix.lts }} | ||
run: tomlq -i -t ".project.name = \"daft-lts\"" pyproject.toml | ||
|
||
- name: Configure RUSTFLAGS | ||
run: if [[ ${{ matrix.lts }} ]]; then echo "RUSTFLAGS=-C target-feature=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+cmpxchg16b" >> $GITHUB_ENV echo "CFLAGS=-msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16" >> $GITHUB_ENV else echo "RUSTFLAGS=-C target-feature=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+cmpxchg16b,+avx,+avx2,+fma,+bmi1,+bmi2,+lzcnt,+pclmulqdq,+movbe -Z tune-cpu=skylake" >> $GITHUB_ENV echo "CFLAGS=-msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16 -mavx -mavx2 -mfma -mbmi -mbmi2 -mlzcnt -mpclmul -mmovbe" >> $GITHUB_ENV fi | ||
|
||
- name: Build wheels - Mac and Windows x86 | ||
if: ${{ ((matrix.os == 'macos') || (matrix.os == 'windows')) && (matrix.compile_arch == 'x86_64') }} | ||
uses: messense/maturin-action@v1 | ||
with: | ||
target: x86_64 | ||
args: --profile release-lto --out dist | ||
env: | ||
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2 | ||
RUSTFLAGS: $RUSTFLAGS | ||
CFLAGS: $CFLAGS | ||
- name: Build wheels - Linux x86 | ||
if: ${{ (matrix.os == 'ubuntu') && (matrix.compile_arch == 'x86_64') }} | ||
uses: messense/maturin-action@v1 | ||
|
@@ -67,7 +78,9 @@ jobs: | |
args: --profile release-lto --out dist --sdist | ||
before-script-linux: yum -y install perl-IPC-Cmd | ||
env: | ||
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma | ||
RUSTFLAGS: $RUSTFLAGS | ||
CFLAGS: $CFLAGS | ||
|
||
- name: Build wheels - Linux aarch64 | ||
if: ${{ (matrix.os == 'ubuntu') && (matrix.compile_arch == 'aarch64') }} | ||
uses: messense/maturin-action@v1 | ||
|
@@ -92,7 +105,7 @@ jobs: | |
- name: Install and test built wheel - Linux and Mac x86_64 | ||
if: ${{ (matrix.os == 'ubuntu') && (matrix.compile_arch == 'x86_64') }} | ||
run: | | ||
uv pip install -r requirements-dev.txt dist/${{ env.PACKAGE_NAME }}-*x86_64*.whl --force-reinstall | ||
uv pip install -r requirements-dev.txt dist/*-*x86_64*.whl --force-reinstall | ||
rm -rf daft | ||
pytest -v | ||
env: | ||
|
@@ -112,97 +125,97 @@ jobs: | |
name: wheels-${{ matrix.os }}-${{ matrix.compile_arch }} | ||
path: dist | ||
|
||
- name: Send Slack notification on failure | ||
uses: slackapi/[email protected] | ||
if: ${{ failure() && (github.ref == 'refs/heads/main') }} | ||
with: | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":rotating_light: Release: Building Wheels <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow> *FAILED* :rotating_light:" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
# - name: Send Slack notification on failure | ||
# uses: slackapi/[email protected] | ||
# if: ${{ failure() && (github.ref == 'refs/heads/main') }} | ||
# with: | ||
# payload: | | ||
# { | ||
# "blocks": [ | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": ":rotating_light: Release: Building Wheels <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow> *FAILED* :rotating_light:" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
# env: | ||
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
|
||
publish: | ||
name: Publish wheels to PYPI and Anaconda | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-and-test | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
- run: pip install -U twine | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: wheels-* | ||
merge-multiple: true | ||
path: dist | ||
- run: ls -R ./dist | ||
- name: Publish bdist package to PYPI | ||
if: ${{ success() && (env.IS_PUSH == 'true') }} | ||
run: python -m twine upload --skip-existing --disable-progress-bar ./dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
# publish: | ||
# name: Publish wheels to PYPI and Anaconda | ||
# runs-on: ubuntu-latest | ||
# needs: | ||
# - build-and-test | ||
# steps: | ||
# - uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: ${{ env.PYTHON_VERSION }} | ||
# architecture: x64 | ||
# - run: pip install -U twine | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# pattern: wheels-* | ||
# merge-multiple: true | ||
# path: dist | ||
# - run: ls -R ./dist | ||
# - name: Publish bdist package to PYPI | ||
# if: ${{ success() && (env.IS_PUSH == 'true') }} | ||
# run: python -m twine upload --skip-existing --disable-progress-bar ./dist/* | ||
# env: | ||
# TWINE_USERNAME: __token__ | ||
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
# Really doesn't matter what version we upload with | ||
# just the version we test with | ||
python-version: '3.9' | ||
channels: conda-forge | ||
channel-priority: true | ||
|
||
- name: Install anaconda client | ||
shell: bash -el {0} | ||
run: conda install -q -y anaconda-client "urllib3<2.0" | ||
|
||
- name: Upload wheels to anaconda nightly | ||
if: ${{ success() && (((env.IS_SCHEDULE_DISPATCH == 'true') && (github.ref == 'refs/heads/main')) || env.IS_PUSH == 'true') }} | ||
shell: bash -el {0} | ||
env: | ||
DAFT_STAGING_UPLOAD_TOKEN: ${{ secrets.DAFT_STAGING_UPLOAD_TOKEN }} | ||
DAFT_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.DAFT_NIGHTLY_UPLOAD_TOKEN }} | ||
run: | | ||
source ci/upload_wheels.sh | ||
set_upload_vars | ||
# trigger an upload to | ||
# https://anaconda.org/daft-nightly/getdaft | ||
# for cron jobs or "Run workflow" (restricted to main branch). | ||
# Tags will upload to | ||
# https://anaconda.org/daft/getdaft | ||
# The tokens were originally generated at anaconda.org | ||
upload_wheels | ||
- name: Send Slack notification on failure | ||
uses: slackapi/[email protected] | ||
if: failure() | ||
with: | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":rotating_light: Release: Uploading Wheels <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow> *FAILED* :rotating_light:" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
# - uses: conda-incubator/setup-miniconda@v3 | ||
# with: | ||
# # Really doesn't matter what version we upload with | ||
# # just the version we test with | ||
# python-version: '3.9' | ||
# channels: conda-forge | ||
# channel-priority: true | ||
|
||
# - name: Install anaconda client | ||
# shell: bash -el {0} | ||
# run: conda install -q -y anaconda-client "urllib3<2.0" | ||
|
||
# - name: Upload wheels to anaconda nightly | ||
# if: ${{ success() && (((env.IS_SCHEDULE_DISPATCH == 'true') && (github.ref == 'refs/heads/main')) || env.IS_PUSH == 'true') }} | ||
# shell: bash -el {0} | ||
# env: | ||
# DAFT_STAGING_UPLOAD_TOKEN: ${{ secrets.DAFT_STAGING_UPLOAD_TOKEN }} | ||
# DAFT_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.DAFT_NIGHTLY_UPLOAD_TOKEN }} | ||
# run: | | ||
# source ci/upload_wheels.sh | ||
# set_upload_vars | ||
# # trigger an upload to | ||
# # https://anaconda.org/daft-nightly/getdaft | ||
# # for cron jobs or "Run workflow" (restricted to main branch). | ||
# # Tags will upload to | ||
# # https://anaconda.org/daft/getdaft | ||
# # The tokens were originally generated at anaconda.org | ||
# upload_wheels | ||
|
||
# - name: Send Slack notification on failure | ||
# uses: slackapi/[email protected] | ||
# if: failure() | ||
# with: | ||
# payload: | | ||
# { | ||
# "blocks": [ | ||
# { | ||
# "type": "section", | ||
# "text": { | ||
# "type": "mrkdwn", | ||
# "text": ":rotating_light: Release: Uploading Wheels <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow> *FAILED* :rotating_light:" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
# env: | ||
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |