Skip to content

Commit

Permalink
Add automatic retries and list interface (#15)
Browse files Browse the repository at this point in the history
* Add automatic retries

Thanks to DrYenyen for idea and initial implementation

* Add an option to list interfaces

This feature will help users on Windows, where interface names are not easily retrievable.

* Switch to build.rs and only show interface names

Also add windows build to actions
  • Loading branch information
fedebuonco authored Nov 3, 2024
1 parent 7666856 commit b36d7a3
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 117 deletions.
5 changes: 0 additions & 5 deletions .cargo/config.toml

This file was deleted.

43 changes: 37 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
tags:
- "v*.*.*"
workflow_dispatch: # This adds the manual trigger option
jobs:
build:
strategy:
Expand All @@ -20,29 +21,59 @@ jobs:
target: aarch64-apple-darwin
extension: ""
archive: tar.gz
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
extension: .exe
archive: tar.gz

runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build for Linux/macOS
if: "!endsWith(matrix.target, 'windows-msvc')"

- name: Install MinGW for Windows cross-compilation
if: matrix.target == 'x86_64-pc-windows-gnu'
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64
- name: Download NPCAP SDK
if: contains(matrix.target, 'windows')
run: |
wget https://npcap.com/dist/npcap-sdk-1.13.zip -O /tmp/sdk.zip
unzip /tmp/sdk.zip -d /tmp/sdk
mkdir -p /tmp/sdk/lib/x64
mkdir -p /tmp/sdk86/lib
mkdir -p /tmp/sdkarm/lib
cp /tmp/sdk/Lib/x64/*lib /tmp/sdk/lib/x64
cp /tmp/sdk/Lib/x64/*lib /tmp/sdk/lib
cp /tmp/sdk/Lib/*lib /tmp/sdk86/lib
cp -r /tmp/sdk/Include /tmp/sdk86
cp /tmp/sdk/Lib/ARM64/*lib /tmp/sdkarm/lib
cp -r /tmp/sdk/Include /tmp/sdkarm
- name: Build for Linux/macOS/Windows
run: |
cargo build --release --target ${{ matrix.target }}
mkdir -p release/yapppwn-${{ matrix.target }}
cp target/${{ matrix.target }}/release/yapppwn${{ matrix.extension }} release/yapppwn-${{ matrix.target }}/yapppwn
chmod +x release/yapppwn-${{ matrix.target }}/yapppwn
cp target/${{ matrix.target }}/release/yapppwn${{ matrix.extension }} release/yapppwn-${{ matrix.target }}/yapppwn${{ matrix.extension }}
- name: Package artifact
run: |
cd release
tar -czf yapppwn-${{ matrix.target }}.${{ matrix.archive }} yapppwn-${{ matrix.target }}/yapppwn
tar -czf yapppwn-${{ matrix.target }}.${{ matrix.archive }} yapppwn-${{ matrix.target }}/yapppwn${{ matrix.extension }}
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: yapppwn-${{ matrix.target }}.${{ matrix.archive }}
path: release/yapppwn-${{ matrix.target }}.${{ matrix.archive }}

create_release:
needs: build
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit b36d7a3

Please sign in to comment.