Skip to content

Commit

Permalink
env: compile with cross
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Nov 22, 2023
1 parent 22fbb9a commit 5dd2ec7
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 326 deletions.
18 changes: 9 additions & 9 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld"]
#[target.x86_64-unknown-linux-gnu]
#linker = "clang"
#rustflags = ["-Clink-arg=-fuse-ld=lld"]

# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which ilslsncludes lld with the "brew" package manager:
# `brew install llvm`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld"]
#[target.x86_64-apple-darwin]
#rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
#[target.aarch64-apple-darwin]
#rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
#[target.x86_64-pc-windows-msvc]
#linker = "rust-lld.exe"

# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
#- x86_64-apple-darwin
#- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
#- x86_64-unknown-linux-musl
- x86_64-unknown-linux-musl

steps:
- name: checkout repo
Expand All @@ -39,9 +39,13 @@ jobs:
with:
toolchain: 1.74.0

- name: install cross
run: |
cargo install cross
- name: build
run: |
cargo build --release --all-features --target ${{ matrix.arch }}
cross build --release --all-features --target ${{ matrix.arch }}
- name: compress with upx
uses: crazy-max/ghaction-upx@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
#- x86_64-apple-darwin
#- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
#- x86_64-unknown-linux-musl
- x86_64-unknown-linux-musl

steps:
- name: checkout repo
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ jobs:
run: |
mkdir target/release
mv target/rebar-x86_64-unknown-linux-gnu/rebar target/release/rebar-x86_64-unknown-linux-gnu
mv target/rebar-x86_64-unknown-linux-musl/rebar target/release/rebar-x86_64-unknown-linux-musl
ls -l target/release/
- name: create release
uses: ncipollo/release-action@v1
with:
# comma-separated
artifacts: "target/release/rebar-x86_64-unknown-linux-gnu"
artifacts: "target/release/rebar-x86_64-unknown-linux-gnu,target/release/rebar-x86_64-unknown-linux-musl"
# aarch64-apple-darwin
# aarch64-unknown-linux-gnu
# aarch64-unknown-linux-musl
# x86_64-apple-darwin
# x86_64-pc-windows-gnu
# x86_64-unknown-linux-musl

artifactErrorsFailBuild: true
draft: true
generateReleaseNotes: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
#- x86_64-apple-darwin
#- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
#- x86_64-unknown-linux-musl
- x86_64-unknown-linux-musl

steps:
- name: checkout repo
Expand Down
Loading

0 comments on commit 5dd2ec7

Please sign in to comment.