@@ -4,16 +4,28 @@ inputs:
44 python-version :
55 description : " Python version to use"
66 required : true
7- target :
8- description : " Target that is the worker is built for"
9- required : true
107
118runs :
129 using : composite
1310 steps :
1411 - name : Checkout repository
1512 uses : actions/checkout@v4
1613
14+ - name : Set target based on OS and arch
15+ shell : bash
16+ run : |
17+ if [[ "${RUNNER_OS}" == "Linux" ]]; then
18+ echo "TARGET=x86_64-unknown-linux-gnu" >> $GITHUB_ENV
19+ elif [[ "${RUNNER_OS}" == "macOS" ]]; then
20+ if [[ "${RUNNER_ARCH}" == "ARM64" ]]; then
21+ echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
22+ else
23+ echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
24+ fi
25+ elif [[ "${RUNNER_OS}" == "Windows" ]]; then
26+ echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
27+ fi
28+
1729 - name : Set up Python ${{ inputs.python-version }}
1830 uses : actions/setup-python@v5
1931 with :
@@ -27,14 +39,14 @@ runs:
2739
2840 - name : Build
2941 shell : bash -euxo pipefail {0}
30- run : scripts/build-worker.sh ${{ inputs .target }}
42+ run : scripts/build-worker.sh ${{ steps.target.outputs .target }}
3143
3244 - name : Package the worker (Linux)
3345 if : runner.os == 'Linux'
3446 shell : bash -euxo pipefail {0}
3547 run : |
3648 cd dist
37- mv fluxqueue-worker-${{ inputs .target }} fluxqueue-worker
49+ mv fluxqueue-worker-${{ steps.target.outputs .target }} fluxqueue-worker
3850 tar -czvf fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-linux-x86_64.tar.gz fluxqueue-worker
3951 rm fluxqueue-worker
4052
@@ -43,21 +55,21 @@ runs:
4355 shell : bash -euxo pipefail {0}
4456 run : |
4557 cd dist
46- mv fluxqueue-worker-${{ inputs .target }} fluxqueue-worker
47- zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-${{ inputs .target }}.zip fluxqueue-worker
58+ mv fluxqueue-worker-${{ steps.target.outputs .target }} fluxqueue-worker
59+ zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-${{ steps.target.outputs .target }}.zip fluxqueue-worker
4860 rm fluxqueue-worker
4961
5062 - name : Package the worker (Windows)
5163 if : runner.os == 'Windows'
52- shell : bash -euxo pipefail {0}
64+ shell : pwsh
5365 run : |
5466 cd dist
55- mv fluxqueue-worker-${{ inputs .target }}.exe fluxqueue-worker.exe
56- zip fluxqueue-${{ github.ref_name }}-py${{ inputs.python-version }}-windows-x86_64.zip fluxqueue-worker.exe
67+ mv fluxqueue-worker-${{ steps.target.outputs .target }}.exe fluxqueue-worker.exe
68+ Compress-Archive -Path fluxqueue-worker.exe -DestinationPath fluxqueue- ${{ github.ref_name }}-py${{ inputs.python-version }}-windows-x86_64.zip
5769 rm fluxqueue-worker.exe
5870
5971 - name : Upload build artifact
6072 uses : actions/upload-artifact@v4
6173 with :
62- name : fluxqueue-worker-${{ inputs .target }}-py${{ inputs.python-version }}
74+ name : fluxqueue-worker-${{ steps.target.outputs .target }}-py${{ inputs.python-version }}
6375 path : dist/*
0 commit comments