-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
75 lines (65 loc) · 2.49 KB
/
action.yml
File metadata and controls
75 lines (65 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: "Build Worker"
description: "Build worker"
inputs:
python-version:
description: "Python version to use"
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:
python-version: ${{ inputs.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Build
shell: bash -euxo pipefail {0}
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-${{ 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
- name: Package the worker (macOS)
if: runner.os == 'macOS'
shell: bash -euxo pipefail {0}
run: |
cd dist
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: pwsh
run: |
cd dist
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-${{ steps.target.outputs.target }}-py${{ inputs.python-version }}
path: dist/*