Skip to content

Commit

Permalink
feat(main): add sealos bin files
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu committed Jun 21, 2024
1 parent 2af1b55 commit a961ffa
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,23 @@ jobs:
fail-fast: false
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
sealos: https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
sealos: https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_arm64.tar.gz
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
sealos: https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-13
- target: aarch64-apple-darwin
os: macos-latest
sealos: https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_arm64.tar.gz
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -54,6 +52,9 @@ jobs:
RUST_CACHE_KEY_OS: rust-cache-${{ matrix.target }}
- name: Install just
uses: taiki-e/install-action@just
- name: Install sealos
run: |
url=${{ matrix.sealos }} just files
- name: Install requirements
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Setup target
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
target
.idea
Cargo.lock
files/sealos
sealos.tar.gz
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ edition = "2021"
description = "rbuild-runtime, a rusty-hermit application"
repository = "https://github.com/rust-learn-days/rbuild-runtime"
[dependencies]
rust-embed="8.4.0"
1 change: 1 addition & 0 deletions files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## using save some binary data in a file
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ build-release:

changelog:
git-cliff --config cliff.toml > CHANGELOG.md

files:
wget -O sealos.tar.gz ${url:-https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz}
tar -zxvf sealos.tar.gz sealos && rm -rm sealos.tar.gz
chmod a+x sealos && mv sealos files/
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
use rust_embed::Embed;

#[derive(Embed)]
#[folder = "files/"]
struct Asset;

fn main() {
println!("Hello, world!");
let asset = Asset::get("sealos").unwrap();
println!("asset: {:?}", asset.data.len());
}

0 comments on commit a961ffa

Please sign in to comment.