Skip to content

Commit

Permalink
more full run
Browse files Browse the repository at this point in the history
  • Loading branch information
benjirewis committed Dec 20, 2023
1 parent 6a80266 commit 6859017
Showing 1 changed file with 91 additions and 92 deletions.
183 changes: 91 additions & 92 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ on:
jobs:
prepare:
if: github.repository_owner == 'viamrobotics'
runs-on: [buildjet-8vcpu-ubuntu-2204-arm]
runs-on: [self-hosted, x64]
container:
image: ghcr.io/viamrobotics/canon:arm64
image: ghcr.io/viamrobotics/canon:amd64
outputs:
version: ${{ steps.which_version.outputs.version }}
sha: ${{ steps.commit.outputs.commit_long_sha }}
Expand Down Expand Up @@ -78,107 +78,106 @@ jobs:
default_author: github_actions
message: Bumping version to v${{ steps.which_version.outputs.version }} [skip ci]

#build_macos:
#if: github.repository_owner == 'viamrobotics'
#needs: [prepare]
#runs-on: [self-hosted, ARM64, macOS]
#strategy:
#fail-fast: false
#matrix:
#include:
#- target: aarch64-apple-darwin
#platform: macosx_arm64
#- target: x86_64-apple-darwin
#platform: macosx_x86_64
#steps:
#- name: Checkout Code
#uses: actions/checkout@v3
#with:
#ref: ${{ needs.prepare.outputs.sha }}
#- name: Setup rust toolchain
#uses: dtolnay/rust-toolchain@stable
#with:
#toolchain: stable
#targets: ${{ matrix.target }}
#- name: Setup build directory
#run: mkdir builds
#- name: Build
#run: |
#cargo build --release --target=${{ matrix.target }}
#- name: Copy
#run: |
#cp target/${{ matrix.target }}/release/libviam_rust_utils.dylib builds/libviam_rust_utils-${{ matrix.platform }}.dylib
#cp target/${{ matrix.target }}/release/libviam_rust_utils.a builds/libviam_rust_utils-${{ matrix.platform }}.a
#- name: Correct install path
#run: |
#install_name_tool -id "@rpath/libviam_rust_utils.dylib" builds/libviam_rust_utils-${{ matrix.platform }}.dylib
#- name: Upload artifacts
#uses: actions/upload-artifact@v3
#with:
#name: builds
#path: builds
build_macos:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: [self-hosted, ARM64, macOS]
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
platform: macosx_arm64
- target: x86_64-apple-darwin
platform: macosx_x86_64
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ needs.prepare.outputs.sha }}
- name: Setup rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Setup build directory
run: mkdir builds
- name: Build
run: |
cargo build --release --target=${{ matrix.target }}
- name: Copy
run: |
cp target/${{ matrix.target }}/release/libviam_rust_utils.dylib builds/libviam_rust_utils-${{ matrix.platform }}.dylib
cp target/${{ matrix.target }}/release/libviam_rust_utils.a builds/libviam_rust_utils-${{ matrix.platform }}.a
- name: Correct install path
run: |
install_name_tool -id "@rpath/libviam_rust_utils.dylib" builds/libviam_rust_utils-${{ matrix.platform }}.dylib
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: builds
path: builds

# build_linux builds all but aarch64.
#build_linux:
#if: github.repository_owner == 'viamrobotics'
#needs: [prepare]
#runs-on: [self-hosted, x64]
#container:
#image: ghcr.io/cross-rs/${{ matrix.image }}
#strategy:
#fail-fast: false
#matrix:
#include:
#- target: aarch64-unknown-linux-gnu
#platform: linux_aarch64
#image: aarch64-unknown-linux-gnu:main-centos
#- target: x86_64-unknown-linux-gnu
#platform: linux_x86_64
#image: x86_64-unknown-linux-gnu:main-centos
#- target: arm-unknown-linux-gnueabihf
#platform: linux_armv6l
#image: arm-unknown-linux-gnueabihf:main
#steps:
#- name: Checkout Code
#uses: actions/checkout@v3
#with:
#ref: ${{ needs.prepare.outputs.sha }}
#- name: Setup rust toolchain
#shell: bash
#run: |
#curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
#source "$HOME/.cargo/env"
#rustup target add ${{ matrix.target }}
#- name: Setup build directory
#run: mkdir builds
#- name: Build
#shell: bash
#run: |
#source "$HOME/.cargo/env"
#cargo build --release --target=${{ matrix.target }}
#- name: Copy
#run: |
#cp target/${{ matrix.target }}/release/libviam_rust_utils.so builds/libviam_rust_utils-${{ matrix.platform }}.so
#cp target/${{ matrix.target }}/release/libviam_rust_utils.a builds/libviam_rust_utils-${{ matrix.platform }}.a
#- name: Upload artifacts
#uses: actions/upload-artifact@v3
#with:
#name: builds
#path: builds
# build_linux builds all but aarch64 (aarch64 requires a different toolchain setup).
build_linux:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: [self-hosted, x64]
container:
image: ghcr.io/cross-rs/${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
platform: linux_x86_64
image: x86_64-unknown-linux-gnu:main-centos
- target: arm-unknown-linux-gnueabihf
platform: linux_armv6l
image: arm-unknown-linux-gnueabihf:main
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ needs.prepare.outputs.sha }}
- name: Setup rust toolchain
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add ${{ matrix.target }}
- name: Setup build directory
run: mkdir builds
- name: Build
shell: bash
run: |
source "$HOME/.cargo/env"
cargo build --release --target=${{ matrix.target }}
- name: Copy
run: |
cp target/${{ matrix.target }}/release/libviam_rust_utils.so builds/libviam_rust_utils-${{ matrix.platform }}.so
cp target/${{ matrix.target }}/release/libviam_rust_utils.a builds/libviam_rust_utils-${{ matrix.platform }}.a
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: builds
path: builds

# cross-compilation for aarch64 does not seem to work for the ring crate, so
# we need a second job with a setup mostly copied from the micro-rdk release.
build_aarch64_linux:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: [buildjet-8vcpu-ubuntu-2204-arm]
runs-on: [self-hosted, x64]
container:
image: ghcr.io/viamrobotics/canon:arm64
strategy:
fail-fast: false
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ needs.prepare.outputs.sha }}
# Variables for rust toolchain setup copied from the micro-rdk release
# process.
- name: Setup rust toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -201,7 +200,7 @@ jobs:
path: builds

#release:
#needs: [prepare, build_macos, build_linux]
#needs: [prepare, build_macos, build_linux, build_aarch64_linux]
##if: github.repository_owner == 'viamrobotics'
#runs-on: [self-hosted, x64]
#container:
Expand Down

0 comments on commit 6859017

Please sign in to comment.