-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Genereates binaries for x86_64 and arm-32 (#24)
* cross compilation * github actions * ignore ci changes * single source of truth * bump version * publish * fix runs-on * dependency for publish * changes * update cargo changes * strict version dependency
- Loading branch information
1 parent
450169f
commit 73f5e56
Showing
8 changed files
with
146 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
permissions: | ||
contents: write | ||
jobs: | ||
build: | ||
name: Release - ${{ matrix.platform.release_for }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- release_for: Arm-32 | ||
os: ubuntu-latest | ||
target: arm-unknown-linux-gnueabihf | ||
bin: localtunnel | ||
name: localtunnel-linux-arm32.tar.tz | ||
command: build | ||
- release_for: x86_64 | ||
os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
bin: localtunnel | ||
name: localtunnel-linux-x86_64.tar.tz | ||
command: build | ||
runs-on: ${{ matrix.platform.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build binary | ||
uses: houseabsolute/actions-rust-cross@v0 | ||
with: | ||
command: ${{ matrix.platform.command }} | ||
target: ${{ matrix.platform.target }} | ||
args: "--locked --release" | ||
- name: Package as archive | ||
shell: bash | ||
run: | | ||
cd target/${{ matrix.platform.target }}/release | ||
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | ||
cd - | ||
- name: Upload package as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binaries | ||
path: ${{ matrix.platform.name }} | ||
|
||
publish: | ||
needs: [build] | ||
name: Publish binaries | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: binaries | ||
path: ./binaries | ||
- name: Publish artifacts | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ./binaries/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '.github/workflows/publish.yml' | ||
- '.github/workflows/test.yml' | ||
- '.github/FUNDING.yml' | ||
- '**README.md' | ||
- '.gitignore' | ||
- 'LICENSE' | ||
jobs: | ||
tests-package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Rust tooling | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Cache rust | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Test Rust | ||
run: cargo test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
[workspace] | ||
package.edition = "2021" | ||
package.license = "MIT" | ||
package.repository = "https://github.com/kaichaosun/rlt" | ||
members = ["cli", "client", "server"] | ||
|
||
members = [ | ||
"cli", | ||
"client", | ||
"server" | ||
] | ||
[workspace.dependencies] | ||
tokio = { version = "1.23.0", features = ["full"] } | ||
anyhow = { version = "1.0", features = ["backtrace"] } | ||
log = "0.4" | ||
serde = { version = "1.0", features = ["derive"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[target.arm-unknown-linux-gnueabihf] | ||
pre-build = [ | ||
"dpkg --add-architecture $CROSS_DEB_ARCH", | ||
"apt-get update && apt-get install --assume-yes libssl-dev:amd64 libssl-dev:$CROSS_DEB_ARCH", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
[package] | ||
name = "localtunnel" | ||
version = "0.1.1" | ||
edition = "2021" | ||
version = "0.1.2" | ||
edition.workspace = true | ||
description = "A CLI to proxy with localtunnel server." | ||
license = "MIT" | ||
repository = "https://github.com/kaichaosun/rlt" | ||
license.workspace = true | ||
repository.workspace = true | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
clap = { version = "3.2.14", features = ["derive"] } | ||
localtunnel-client = { path = "../client", version = "0.1.1" } | ||
localtunnel-server = { path = "../server", version = "0.1.1" } | ||
tokio = { version = "1.23.0", features = ["full"] } | ||
log = "0.4" | ||
localtunnel-client = { path = "../client", version = "0.1.2" } | ||
localtunnel-server = { path = "../server", version = "0.1.2" } | ||
tokio = { workspace = true } | ||
log = { workspace = true } | ||
env_logger = "0.9" | ||
anyhow = { version = "1.0", features = ["backtrace"] } | ||
anyhow = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters