Add automatic retries and list interface (#15) #2
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
workflow_dispatch: # This adds the manual trigger option | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
extension: "" | |
archive: tar.gz | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
extension: "" | |
archive: tar.gz | |
- os: macos-14 | |
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: 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${{ matrix.extension }} | |
- name: Package artifact | |
run: | | |
cd release | |
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 | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: artifacts/**/* | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} |