forked from GyulyVGC/sniffnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for Linux, macOS, and Windows
- Loading branch information
Showing
30 changed files
with
558 additions
and
12 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,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[{.gitignore,*.desktop}] | ||
indent_size = 0 | ||
|
||
[*.{json,yml,yaml}] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,20 @@ | ||
* text eol=lf | ||
.* text eol=lf | ||
|
||
*.png binary | ||
*.icns binary | ||
*.ico binary | ||
*.ttf binary | ||
*.mp3 binary | ||
*.rtf binary | ||
*.mmdb binary | ||
|
||
*.rs diff=rust | ||
*.md diff=markdown | ||
|
||
/.github export-ignore | ||
/.design export-ignore | ||
CHANGELOG.md export-ignore | ||
CONTRIBUTING.md export-ignore | ||
CONTRIBUTORS.md export-ignore | ||
CODE_OF_CONDUCT.md export-ignore |
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,119 @@ | ||
name: Build and Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_package: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
targets: >- | ||
x86_64-unknown-linux-gnu | ||
i686-unknown-linux-gnu | ||
aarch64-unknown-linux-gnu | ||
armv7-unknown-linux-gnueabihf | ||
build_targets: >- | ||
--target x86_64-unknown-linux-gnu | ||
--target i686-unknown-linux-gnu | ||
--target aarch64-unknown-linux-gnu | ||
--target armv7-unknown-linux-gnueabihf | ||
- os: macOS-latest | ||
targets: >- | ||
x86_64-apple-darwin | ||
aarch64-apple-darwin | ||
build_targets: >- | ||
--target x86_64-apple-darwin | ||
--target aarch64-apple-darwin | ||
- os: windows-latest | ||
targets: >- | ||
x86_64-pc-windows-msvc | ||
i686-pc-windows-msvc | ||
build_targets: >- | ||
--target x86_64-pc-windows-msvc | ||
--target i686-pc-windows-msvc | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: rustfmt, clippy | ||
targets: ${{ matrix.targets }} | ||
default: true | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release ${{ matrix.build_targets }} | ||
|
||
- name: Package for Debian-based Linux distros | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
cargo install cargo-deb | ||
cargo deb | ||
mkdir artifacts | ||
mv target/debian/*.deb artifacts/ | ||
- name: Package for RPM-based Linux distros | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
cargo install cargo-generate-rpm | ||
cargo generate-rpm | ||
mkdir artifacts | ||
mv target/generate-rpm/*.rpm artifacts/ | ||
- name: Package Universal DMG for macOS | ||
if: matrix.os == 'macOS-latest' | ||
run: | | ||
cargo install cargo-bundle | ||
cargo bundle --release | ||
lipo -create -output \ | ||
target/release/bundle/osx/sniffnet.app/Contents/MacOS/sniffnet \ | ||
target/release/x86_64-apple-darwin/sniffnet \ | ||
target/release/aarch64-apple-darwin/sniffnet | ||
brew install create-dmg | ||
mkdir artifacts | ||
create-dmg \ | ||
--volname "Sniffnet Installer" \ | ||
--window-pos 200 120 \ | ||
--window-size 800 400 \ | ||
--icon-size 100 \ | ||
--app-drop-link 600 185 \ | ||
--icon "target/release/bundle/osx/sniffnet.app" 200 185 \ | ||
--hide-extension "target/release/bundle/osx/sniffnet.app" \ | ||
--app-drop-link 600 185 artifacts/sniffnet-universal.dmg target/release/bundle/osx/sniffnet.app | ||
- name: Package MSI for Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cargo install cargo-wix | ||
cargo wix main.wxs | ||
mkdir artifacts | ||
mv target/wix/*.msi artifacts/ | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.os }}-artifacts | ||
path: artifacts/ | ||
|
||
- name: Download artifacts | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: artifacts/ |
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
Oops, something went wrong.