Skip to content

Modify GitHub Actions #29

Modify GitHub Actions

Modify GitHub Actions #29

Workflow file for this run

name: Build and Publish Wheels
on:
pull_request:
branches: [ main ]
env:
DOMAIN: poolside
REPOSITORY: poolside-dagster
WHEEL_DST: /tmp/sp_wheelhouse
jobs:
build_wheels:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
runs-on: ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }}
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::939990436136:role/gh-action-publish-artifacts-role
aws-region: us-east-1
- name: Make sure destination dir exists
run: |
mkdir -p ${{env.WHEEL_DST}}
if [ ! -d ${{env.WHEEL_DST}} ]; then
echo "wheel dest dir does not exist!"
exit 1
fi
- name: Build for Mac
if: runner.os == 'macOS'
run: |
cmake -B ${{github.workspace}}/build -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root
cmake --build ${{github.workspace}}/build --config Release --target install --parallel 8
env:
CMAKE_OSX_ARCHITECTURES: arm64;x86_64
- name: Install dependencies
working-directory: ${{github.workspace}}/python
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build cibuildwheel
- name: Build wheels
working-directory: ${{github.workspace}}/python
run: python -m cibuildwheel --output-dir ${{env.WHEEL_DST}}
env:
CIBW_ARCHS_LINUX: auto aarch64
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_ARCHS_WINDOWS: auto ARM64
CIBW_SKIP: "pp* *-musllinux_*"
CIBW_BUILD_VERBOSITY: 1
- name: Build sdist archive
working-directory: ${{github.workspace}}/python
run: sh build_sdist.sh
- name: Fetch sdist archive
uses: tj-actions/glob@2944188f585a0ec102a6a82d9eeb3aed69785393 # v22.0.1
id: sdist
with:
files: ./python/dist/*.tar.gz
- name: Build wheel from sdist
run: python -m pip wheel "${{ steps.sdist.outputs.paths }}" --wheel-dir ${{env.WHEEL_DST}} --verbose
- name: Publish
run: |
aws codeartifact login --tool twine --domain ${{env.DOMAIN}} --repository ${{ env.REPOSITORY }}
twine upload --verbose --repository codeartifact ${{env.WHEEL_DST}}/*