Skip to content

Commit

Permalink
try build windows wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Sep 19, 2023
1 parent d93dbf7 commit aaa4d7d
Showing 1 changed file with 95 additions and 91 deletions.
186 changes: 95 additions & 91 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: daft-publish

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: 0 5 * * *

push:
tags:
- v*
workflow_dispatch:

# 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: 0 5 * * *

# push:
# tags:
# - v*
# workflow_dispatch:
pull_request:
branches: [main]
env:
PACKAGE_NAME: getdaft
PYTHON_VERSION: 3.7.16 # to build abi3 wheels
Expand All @@ -32,8 +33,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
# os: [ubuntu, macos]
os: [windows]
compile_arch: [x86_64, aarch64]
exclude:
- os: windows
compile_arch: aarch64
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -46,15 +51,14 @@ jobs:
- run: pip install -U twine toml
- run: python tools/patch_package_version.py
- uses: moonrepo/setup-rust@v0
- name: Build wheels - Mac x86
if: ${{ (matrix.os == 'macos') && (matrix.compile_arch == 'x86_64') }}
- 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
manylinux: auto
args: --profile release-lto --out dist --sdist
env:
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma
RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2
- name: Build wheels - Linux x86
if: ${{ (matrix.os == 'ubuntu') && (matrix.compile_arch == 'x86_64') }}
uses: messense/maturin-action@v1
Expand Down Expand Up @@ -120,75 +124,75 @@ jobs:
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@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- run: pip install -U twine
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: wheels
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@v2
with:
# Really doesn't matter what version we upload with
# just the version we test with
python-version: '3.8'
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' || 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
# publish:
# name: Publish wheels to PYPI and Anaconda
# runs-on: ubuntu-latest
# needs:
# - build-and-test
# steps:
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# architecture: x64
# - run: pip install -U twine
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v3
# with:
# name: wheels
# 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@v2
# with:
# # Really doesn't matter what version we upload with
# # just the version we test with
# python-version: '3.8'
# 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' || 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

0 comments on commit aaa4d7d

Please sign in to comment.