build mac binary in ci (#152)
* build mac binary in ci * update * update * turn on verbose * fix cross compile * update * update * update * update * update * update * updateadd-tracing
parent
552711a560
commit
734957d1de
|
|
@ -4,14 +4,11 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
paths:
|
pull_request:
|
||||||
- 'Dockerfile.rust'
|
branches: ["main" ]
|
||||||
- '.github/workflows/docker.rust.yml'
|
|
||||||
- 'crates/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release-docker:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
@ -21,21 +18,6 @@ jobs:
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Free Disk Space (Ubuntu)
|
|
||||||
uses: jlumbroso/free-disk-space@main
|
|
||||||
with:
|
|
||||||
# this might remove tools that are actually needed,
|
|
||||||
# if set to "true" but frees about 6 GB
|
|
||||||
tool-cache: true
|
|
||||||
|
|
||||||
# all of these default to true, but feel free to set to
|
|
||||||
# "false" if necessary for your workflow
|
|
||||||
android: true
|
|
||||||
dotnet: true
|
|
||||||
haskell: true
|
|
||||||
large-packages: false
|
|
||||||
swap-storage: true
|
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -84,3 +66,31 @@ jobs:
|
||||||
ghcr.io/${{ env.IMAGE_NAME }}:latest
|
ghcr.io/${{ env.IMAGE_NAME }}:latest
|
||||||
cache-from: ${{ steps.cache.outputs.cache-from }}
|
cache-from: ${{ steps.cache.outputs.cache-from }}
|
||||||
cache-to: ${{ steps.cache.outputs.cache-to }}
|
cache-to: ${{ steps.cache.outputs.cache-to }}
|
||||||
|
|
||||||
|
release-binary:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [macos-11]
|
||||||
|
include:
|
||||||
|
- os: macos-11
|
||||||
|
target: aarch64-apple-darwin
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
rustup set auto-self-update disable
|
||||||
|
rustup toolchain install stable --profile minimal --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
cargo build --release --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
retention-days: 3
|
||||||
|
name: tabby_${{ matrix.target }}
|
||||||
|
path: target/${{ matrix.target }}/release/tabby
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
__pycache__
|
__pycache__
|
||||||
data
|
|
||||||
supervisord.pid
|
supervisord.pid
|
||||||
|
/target
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,12 @@
|
||||||
|
[workspace]
|
||||||
|
members = [
|
||||||
|
"crates/tabby",
|
||||||
|
"crates/ctranslate2-bindings",
|
||||||
|
"crates/rust-cxx-cmake-bridge",
|
||||||
|
]
|
||||||
|
|
||||||
|
[workspace.package]
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
authors = ["Meng Zhang"]
|
||||||
|
homepage = "https://github.com/TabbyML/tabby"
|
||||||
|
|
@ -17,17 +17,17 @@ RUN apt-get update && \
|
||||||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
|
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root/workspace
|
||||||
|
COPY Cargo.toml Cargo.toml
|
||||||
|
COPY Cargo.lock Cargo.lock
|
||||||
COPY crates crates
|
COPY crates crates
|
||||||
|
|
||||||
WORKDIR /root/crates/tabby
|
|
||||||
|
|
||||||
RUN mkdir -p /opt/tabby/bin
|
RUN mkdir -p /opt/tabby/bin
|
||||||
RUN mkdir -p /opt/tabby/lib
|
RUN mkdir -p /opt/tabby/lib
|
||||||
RUN mkdir -p target
|
RUN mkdir -p target
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/root/crates/tabby/target \
|
--mount=type=cache,target=/root/workspace/target \
|
||||||
cargo build --features link_shared --release && \
|
cargo build --features link_shared --release && \
|
||||||
cp target/release/tabby /opt/tabby/bin/
|
cp target/release/tabby /opt/tabby/bin/
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue