Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
- Drop tls for embedded devices in release
- Upgrade cross
- Specify rust 1.71
  • Loading branch information
rapiz1 committed Oct 1, 2023
1 parent 3aa6557 commit a6601fd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,84 @@ jobs:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
exe: rathole
cross: false
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
exe: rathole
cross: false
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
exe: rathole
cross: true
- os: ubuntu-latest
target: arm-unknown-linux-musleabi
exe: rathole
cross: true
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
exe: rathole
cross: true
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
exe: rathole
cross: true
- os: ubuntu-latest
target: mips-unknown-linux-gnu
exe: rathole
cross: true
- os: ubuntu-latest
target: mips-unknown-linux-musl
exe: rathole
cross: true
- os: ubuntu-latest
target: mipsel-unknown-linux-gnu
exe: rathole
cross: true
- os: ubuntu-latest
target: mipsel-unknown-linux-musl
exe: rathole
cross: true
- os: ubuntu-latest
target: mips64-unknown-linux-gnuabi64
exe: rathole
cross: true
- os: ubuntu-latest
target: mips64el-unknown-linux-gnuabi64
exe: rathole
cross: true

- os: macos-latest
target: x86_64-apple-darwin
exe: rathole
cross: false

- os: windows-latest
target: x86_64-pc-windows-msvc
exe: rathole.exe
cross: false
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
# Since rust 1.72, some platforms are tier 3
toolchain: 1.71
default: true
- name: Install cross
run: cargo install --version 0.1.16 cross
if: matrix.cross
run: cargo install --version 0.2.5 cross
- name: Install target
if: !matrix.cross
run: rustup target add ${{ matrix.target }}
- name: Exclude TLS Features For Embedded Devices
if: matrix.cross
run: |
echo "RATHOLE_FEATURES=embedded" >> $GITHUB_ENV
echo "BUILDER=cross" >> $GITHUB_ENV
- name: Run tests
run: cross test --release --target ${{ matrix.target }} --verbose
run: ${BUILDER:-cargo} test --release --target ${{ matrix.target }} --verbose --features ${RATHOLE_FEATURES:-default} --no-default-features
- name: Build release
run: cross build --release --target ${{ matrix.target }}
run: ${BUILDER:-cargo} build --release --target ${{ matrix.target }} --features ${RATHOLE_FEATURES:-default}
- name: Run UPX
# Upx may not support some platforms. Ignore the errors
continue-on-error: true
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ websocket = ["tokio-tungstenite", "tokio-util", "futures-core", "futures-sink",
# Configuration hot-reload support
hot-reload = ["notify"]

# Default feature releasing embedded devices
# Cross-compiling with tls is hard. So we don't :(
embedded = ["server", "client", "hot-reload", "noise"]

# Feature to enable tokio-console. Disabled by default.
# Don't enable it unless for debugging purposes.
console = ["console-subscriber", "tokio/tracing"]
Expand Down

0 comments on commit a6601fd

Please sign in to comment.