Skip to content

Test Building for Apple #13

Test Building for Apple

Test Building for Apple #13

Workflow file for this run

name: Test Build
on: workflow_dispatch
jobs:
build:
strategy:
matrix:
include:
- TARGET: x86_64-unknown-linux-gnu # tested in a debian container on a mac
OS: ubuntu-latest
- TARGET: aarch64-apple-darwin
OS: macos-latest
- TARGET: x86_64-pc-windows-msvc
OS: windows-latest
runs-on: ${{ matrix.OS }}
env:
NAME: rhai-test
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build for current target
run: |
cargo build --release --target ${{ matrix.TARGET }}
- name: Get Package Version
run: echo "PACKAGE_VERSION=$(cargo pkgid | cut -d '#' -f 2 | cut -d ':' -f 2)" >> $GITHUB_ENV
- name: Running examples
run: |
echo Built for version ${{ env.PACKAGE_VERSION }}
cargo run
- name: Compress
run: |
mkdir -p ./artifacts
# windows is the only OS using a different convention for executable file name
if [[ $OS =~ ^windows.*$ ]]; then
EXEC=$NAME.exe
else
EXEC=$NAME
fi
TAG=${{ env.PACKAGE_VERSION }}
mv ./target/$TARGET/release/$EXEC ./$EXEC
tar -czf ./artifacts/$NAME-$TARGET-$TAG.tar.gz $EXEC
- name: Archive artifact
uses: actions/upload-artifact@v2
with:
name: result
path: |
./artifacts