-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
930 additions
and
0 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,23 @@ | ||
[target.aarch64-unknown-linux-gnu] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
linker = "aarch64-linux-gnu-gcc" | ||
|
||
[target.mips-unknown-linux-gnu] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
linker = "mips-linux-gnu-gcc" | ||
|
||
[target.mipsel-unknown-linux-gnu] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
linker = "mipsel-linux-gnu-gcc" | ||
|
||
[target.mips64-unknown-linux-gnuabi64] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
linker = "mips64-linux-gnuabi64-gcc" | ||
|
||
[target.mips64el-unknown-linux-gnuabi64] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
linker = "mips64el-linux-gnuabi64-gcc" | ||
|
||
[target.riscv64gc-unknown-linux-gnu] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
linker = "riscv64-linux-gnu-gcc" |
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,54 @@ | ||
on: [push, pull_request] | ||
|
||
name: Continuous integration | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: cargo check | ||
|
||
test: | ||
name: Test Suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: cargo test | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- run: cargo fmt --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add clippy | ||
- run: cargo clippy -- -D warnings |
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,104 @@ | ||
name: release | ||
on: | ||
release: | ||
types: [published] | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
name: deploy | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
build: [linux,aarch64-linux,mips-linux,mipsel-linux,mips64-linux,mips64el-linux,riscv64,macos,macos-arm64,windows] | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
rust: nightly | ||
target: x86_64-unknown-linux-musl | ||
linker: musl-tools | ||
- build: aarch64-linux | ||
os: ubuntu-latest | ||
rust: nightly | ||
target: aarch64-unknown-linux-gnu | ||
linker: gcc-aarch64-linux-gnu | ||
- build: mips-linux | ||
os: ubuntu-latest | ||
rust: stable | ||
target: mips-unknown-linux-gnu | ||
linker: gcc-mips-linux-gnu | ||
- build: mipsel-linux | ||
os: ubuntu-latest | ||
rust: stable | ||
target: mipsel-unknown-linux-gnu | ||
linker: gcc-mipsel-linux-gnu | ||
- build: mips64-linux | ||
os: ubuntu-latest | ||
rust: stable | ||
target: mips64-unknown-linux-gnuabi64 | ||
linker: gcc-mips64-linux-gnuabi64 | ||
- build: mips64el-linux | ||
os: ubuntu-latest | ||
rust: stable | ||
target: mips64el-unknown-linux-gnuabi64 | ||
linker: gcc-mips64el-linux-gnuabi64 | ||
- build: riscv64 | ||
os: ubuntu-latest | ||
rust: stable | ||
target: riscv64gc-unknown-linux-gnu | ||
linker: gcc-riscv64-linux-gnu | ||
- build: macos | ||
os: macos-latest | ||
rust: nightly | ||
target: x86_64-apple-darwin | ||
- build: macos-arm64 | ||
os: macos-latest | ||
rust: nightly | ||
target: aarch64-apple-darwin | ||
- build: windows | ||
os: windows-2019 | ||
rust: nightly-x86_64-msvc | ||
target: x86_64-pc-windows-msvc | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install linker | ||
if: matrix.build == 'linux' || matrix.build == 'aarch64-linux' || matrix.build == 'mips-linux' || matrix.build == 'mipsel-linux' ||matrix.build == 'mips64el-linux' || matrix.build == 'mips64-linux' || matrix.build == 'riscv64' | ||
run: sudo apt-get update && sudo apt-get install ${{ matrix.linker }} -y | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
- name: Build binary | ||
run: cargo build --verbose --release --target ${{ matrix.target }} | ||
env: | ||
RUST_BACKTRACE: 1 | ||
|
||
- name: Strip binary (linux and macos) | ||
if: matrix.build == 'linux' || matrix.build == 'macos' | ||
run: strip "target/${{ matrix.target }}/release/wakeonlan" | ||
|
||
- name: rename binary | ||
shell: bash | ||
run: | | ||
mkdir -p binary | ||
if [ "${{ matrix.build }}" = "windows" ]; then | ||
cp "./target/${{ matrix.target }}/release/wakeonlan.exe" ./binary/wakeonlan-${{ matrix.target }}.exe | ||
else | ||
cp "./target/${{ matrix.target }}/release/wakeonlan" ./binary/wakeonlan-${{ matrix.target }} | ||
fi | ||
- name: Upload binary | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./binary/wakeonlan* | ||
file_glob: true | ||
tag: ${{ github.ref }} | ||
overwrite: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug executable 'duefuse'", | ||
"cargo": { | ||
"args": [ | ||
"build", | ||
"--bin=duefuse", | ||
"--package=duefuse" | ||
], | ||
"filter": { | ||
"name": "duefuse", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [ | ||
"mountpoint", | ||
"--auto_unmount", | ||
"true" | ||
], | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in executable 'duefuse'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--bin=duefuse", | ||
"--package=duefuse" | ||
], | ||
"filter": { | ||
"name": "duefuse", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
File renamed without changes.
Oops, something went wrong.