@@ -43,6 +43,100 @@ jobs:
4343
4444 - uses : ./.github/actions/build-python-packages
4545
46+ - name : Gather package paths
47+ id : package_outputs
48+ run : |
49+ echo "opencue_proto_path=$(find ./packages -name 'opencue_proto-*.whl' -print -quit)" >> $GITHUB_OUTPUT
50+ echo "opencue_rqd_path=$(find ./packages -name 'opencue_rqd-*.whl' -print -quit)" >> $GITHUB_OUTPUT
51+ echo "opencue_pycue_path=$(find ./packages -name 'opencue_pycue-*.whl' -print -quit)" >> $GITHUB_OUTPUT
52+ echo "opencue_pyoutline_path=$(find ./packages -name 'opencue_pyoutline-*.whl' -print -quit)" >> $GITHUB_OUTPUT
53+ echo "opencue_cuesubmit_path=$(find ./packages -name 'opencue_cuesubmit-*.whl' -print -quit)" >> $GITHUB_OUTPUT
54+ echo "opencue_cueadmin_path=$(find ./packages -name 'opencue_cueadmin-*.whl' -print -quit)" >> $GITHUB_OUTPUT
55+ echo "opencue_cueman_path=$(find ./packages -name 'opencue_cueman-*.whl' -print -quit)" >> $GITHUB_OUTPUT
56+ echo "opencue_cuegui_path=$(find ./packages -name 'opencue_cuegui-*.whl' -print -quit)" >> $GITHUB_OUTPUT
57+
58+ build_rust_binaries :
59+ name : Build Rust Binaries
60+ strategy :
61+ matrix :
62+ include :
63+ - target : x86_64-unknown-linux-gnu
64+ os : ubuntu-22.04
65+ - target : x86_64-unknown-linux-musl
66+ os : ubuntu-22.04
67+ - target : x86_64-apple-darwin
68+ os : macos-13
69+ - target : aarch64-apple-darwin
70+ os : macos-13
71+ runs-on : ${{ matrix.os }}
72+ steps :
73+ - uses : actions/checkout@v4
74+ with :
75+ fetch-tags : true
76+ fetch-depth : 0
77+
78+ - name : Mark repository as safe
79+ run : git config --global --add safe.directory $GITHUB_WORKSPACE
80+
81+ - name : Get current tag name
82+ run : echo "TAG_NAME=${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV}
83+
84+ - name : Verify tag name and version match
85+ run : |
86+ set -e
87+ if [ "v$(ci/generate_version_number.py)" != "${TAG_NAME}" ]; then
88+ echo "Version check failed: code version v$(ci/generate_version_number.py) does not match tag name ${TAG_NAME}"
89+ echo "Original GITHUB_REF: ${GITHUB_REF}"
90+ exit 1
91+ fi
92+
93+ - name : Install Rust
94+ uses : dtolnay/rust-toolchain@stable
95+ with :
96+ targets : ${{ matrix.target }}
97+
98+ - name : Install dependencies (Ubuntu)
99+ if : matrix.os == 'ubuntu-22.04'
100+ run : |
101+ sudo apt-get update
102+ sudo apt-get install -y libx11-dev protobuf-compiler
103+ if [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]; then
104+ sudo apt-get install -y musl-tools
105+ fi
106+
107+ - name : Install dependencies (macOS)
108+ if : matrix.os == 'macos-13'
109+ run : |
110+ brew install protobuf
111+
112+ - name : Set build ID
113+ run : |
114+ echo "BUILD_ID=$(ci/generate_version_number.py)" >> $GITHUB_ENV
115+
116+ - name : Build Rust binaries
117+ run : |
118+ cd rust
119+ cargo build --release --target ${{ matrix.target }} --no-default-features
120+
121+ - name : Create release directory
122+ run : mkdir -p release
123+
124+ - name : Copy binaries (Linux)
125+ if : matrix.os == 'ubuntu-22.04'
126+ run : |
127+ cp rust/target/${{ matrix.target }}/release/openrqd release/openrqd-${{ env.BUILD_ID }}-${{ matrix.target }}
128+
129+ - name : Copy binaries (macOS)
130+ if : matrix.os == 'macos-13'
131+ run : |
132+ cp rust/target/${{ matrix.target }}/release/openrqd release/openrqd-${{ env.BUILD_ID }}-${{ matrix.target }}
133+
134+ - name : Upload binaries
135+ uses : actions/upload-artifact@v4
136+ with :
137+ name : rust-binaries-${{ matrix.target }}
138+ path : release/
139+
46140 upload_python_packages_test :
47141 needs : build_opencue_packages
48142 runs-on : ubuntu-22.04
@@ -133,7 +227,7 @@ jobs:
133227 # readme-filepath: ./${{ matrix.component }}/README.md
134228
135229 create_release :
136- # needs: preflight
230+ needs : build_rust_binaries
137231 name : Create Release
138232 environment : dockerhub
139233 runs-on : ubuntu-22.04
@@ -159,6 +253,13 @@ jobs:
159253 echo "Build ID: $(ci/generate_version_number.py)"
160254 echo "BUILD_ID=$(ci/generate_version_number.py)" >> ${GITHUB_ENV}
161255
256+ - name : Download Rust binaries artifacts
257+ uses : actions/download-artifact@v4
258+ with :
259+ pattern : rust-binaries-*
260+ path : rust-binaries
261+ merge-multiple : true
262+
162263 - name : Fetch artifacts
163264 id : fetch_artifacts
164265 env :
@@ -320,3 +421,43 @@ jobs:
320421 asset_path : ${{ github.workspace }}/artifacts/cueman-${{ env.BUILD_ID }}-py2.py3-none-any.whl
321422 asset_name : cueman-${{ env.BUILD_ID }}-py2.py3-none-any.whl
322423 asset_content_type : application/octet-stream
424+
425+ - name : Upload openrqd (Linux GNU)
426+ uses : actions/upload-release-asset@v1
427+ env :
428+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
429+ with :
430+ upload_url : ${{ steps.create_release.outputs.upload_url }}
431+ asset_path : rust-binaries/openrqd-${{ env.BUILD_ID }}-x86_64-unknown-linux-gnu
432+ asset_name : openrqd-${{ env.BUILD_ID }}-x86_64-unknown-linux-gnu
433+ asset_content_type : application/octet-stream
434+
435+ - name : Upload openrqd (Linux MUSL)
436+ uses : actions/upload-release-asset@v1
437+ env :
438+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
439+ with :
440+ upload_url : ${{ steps.create_release.outputs.upload_url }}
441+ asset_path : rust-binaries/openrqd-${{ env.BUILD_ID }}-x86_64-unknown-linux-musl
442+ asset_name : openrqd-${{ env.BUILD_ID }}-x86_64-unknown-linux-musl
443+ asset_content_type : application/octet-stream
444+
445+ - name : Upload openrqd (macOS Intel)
446+ uses : actions/upload-release-asset@v1
447+ env :
448+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
449+ with :
450+ upload_url : ${{ steps.create_release.outputs.upload_url }}
451+ asset_path : rust-binaries/openrqd-${{ env.BUILD_ID }}-x86_64-apple-darwin
452+ asset_name : openrqd-${{ env.BUILD_ID }}-x86_64-apple-darwin
453+ asset_content_type : application/octet-stream
454+
455+ - name : Upload openrqd (macOS Apple Silicon)
456+ uses : actions/upload-release-asset@v1
457+ env :
458+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
459+ with :
460+ upload_url : ${{ steps.create_release.outputs.upload_url }}
461+ asset_path : rust-binaries/openrqd-${{ env.BUILD_ID }}-aarch64-apple-darwin
462+ asset_name : openrqd-${{ env.BUILD_ID }}-aarch64-apple-darwin
463+ asset_content_type : application/octet-stream
0 commit comments