Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 16 additions & 5 deletions .github/actions/build-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
python-version:
description: "Python version"
required: true
target:
description: "Target to build the package for"
required: true

runs:
using: composite
Expand All @@ -15,14 +12,28 @@ runs:
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Set target based on OS and arch
shell: bash
run: |
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "TARGET=x86_64-unknown-linux-gnu" >> $GITHUB_ENV
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
if [[ "${RUNNER_ARCH}" == "ARM64" ]]; then
echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
else
echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
fi
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
fi
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ inputs.target }}
target: ${{ steps.target.outputs.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ inputs.target }}
name: wheels-${{ steps.target.outputs.target }}
path: dist
34 changes: 23 additions & 11 deletions .github/actions/build-worker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,28 @@ inputs:
python-version:
description: "Python version to use"
required: true
target:
description: "Target that is the worker is built for"
required: true

runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set target based on OS and arch
shell: bash
run: |
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "TARGET=x86_64-unknown-linux-gnu" >> $GITHUB_ENV
elif [[ "${RUNNER_OS}" == "macOS" ]]; then
if [[ "${RUNNER_ARCH}" == "ARM64" ]]; then
echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
else
echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
fi
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
fi

- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -27,14 +39,14 @@ runs:

- name: Build
shell: bash -euxo pipefail {0}
run: scripts/build-worker.sh ${{ inputs.target }}
run: scripts/build-worker.sh ${{ steps.target.outputs.target }}

- name: Package the worker (Linux)
if: runner.os == 'Linux'
shell: bash -euxo pipefail {0}
run: |
cd dist
mv fluxqueue-worker-${{ inputs.target }} fluxqueue-worker
mv fluxqueue-worker-${{ steps.target.outputs.target }} fluxqueue-worker
tar -czvf fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-linux-x86_64.tar.gz fluxqueue-worker
rm fluxqueue-worker

Expand All @@ -43,21 +55,21 @@ runs:
shell: bash -euxo pipefail {0}
run: |
cd dist
mv fluxqueue-worker-${{ inputs.target }} fluxqueue-worker
zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-${{ inputs.target }}.zip fluxqueue-worker
mv fluxqueue-worker-${{ steps.target.outputs.target }} fluxqueue-worker
zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-${{ steps.target.outputs.target }}.zip fluxqueue-worker
rm fluxqueue-worker

- name: Package the worker (Windows)
if: runner.os == 'Windows'
shell: bash -euxo pipefail {0}
shell: pwsh
run: |
cd dist
mv fluxqueue-worker-${{ inputs.target }}.exe fluxqueue-worker.exe
zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-windows-x86_64.zip fluxqueue-worker.exe
mv fluxqueue-worker-${{ steps.target.outputs.target }}.exe fluxqueue-worker.exe
Compress-Archive -Path fluxqueue-worker.exe -DestinationPath fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-windows-x86_64.zip
rm fluxqueue-worker.exe

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: fluxqueue-worker-${{ inputs.target }}-py${{ inputs.python-version }}
name: fluxqueue-worker-${{ steps.target.outputs.target }}-py${{ inputs.python-version }}
path: dist/*
11 changes: 1 addition & 10 deletions .github/workflows/release-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,15 @@ jobs:
name: ${{ matrix.os }} (Py ${{ matrix.python-version }})
strategy:
matrix:
os: [ubuntu-latest, macos-15-arm64, macos-15-intel, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-15-intel
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Run Build Suite
uses: ./.github/actions/build-worker
with:
python-version: ${{ matrix.python-version }}
target: ${{ matrix.target }}

release:
if: github.repository_owner == 'ccxlv'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-15-intel]
python-version: ["3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest, macos-15-intel, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down