Modify GitHub Actions #21
Workflow file for this run
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
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-14] | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
# - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
- 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: Install cibuildwheel | |
working-directory: ${{github.workspace}}/python | |
run: | | |
python3 -m pip install --require-hashes --no-dependencies -r ../.github/workflows/requirements/base.txt | |
python3 -m pip install --require-hashes --no-dependencies -r ../.github/workflows/requirements/cibuildwheel.txt | |
- 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: Build wheels | |
working-directory: ${{github.workspace}}/python | |
run: python3 -m cibuildwheel --output-dir ${{env.WHEEL_DST}} | |
env: | |
# CIBW_BUILD: cp311-* cp312-* | |
CIBW_BUILD: cp312-* | |
CIBW_ARCHS_LINUX: x86_64 aarch64 | |
CIBW_ARCHS_MACOS: 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: python3 -m pip wheel "${{ steps.sdist.outputs.paths }}" --wheel-dir=${{env.WHEEL_DST}} --verbose | |
# - name: Authenticate with AWS CodeArtifact | |
# run: | | |
# CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain ${{env.DOMAIN}} --query authorizationToken --output text) | |
# echo "[distutils]" > ~/.pypirc | |
# echo "index-servers = codeartifact" >> ~/.pypirc | |
# echo "[codeartifact]" >> ~/.pypirc | |
# echo "repository: ${{ env.REPOSITORY }}" >> ~/.pypirc | |
# echo "username: aws" >> ~/.pypirc | |
# echo "password: ${CODEARTIFACT_AUTH_TOKEN}" >> ~/.pypirc | |
- name: Publish | |
run: | | |
# export TWINE_USERNAME=aws | |
# export TWINE_PASSWORD=`aws codeartifact get-authorization-token --domain ${{env.DOMAIN}} --query authorizationToken --output text` | |
# export TWINE_REPOSITORY_URL=`aws codeartifact get-repository-endpoint --domain ${{env.DOMAIN}} --repository ${{ env.REPOSITORY }} --region us-east-1 --format pypi --query repositoryEndpoint --output text` | |
aws codeartifact login --tool twine --domain ${{env.DOMAIN}} --repository ${{ env.REPOSITORY }} | |
twine upload --verbose --repository codeartifact ${{env.WHEEL_DST}}/*.whl |