mostly licensing and docker stuff
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
name: Compile to Binary
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master, dev ]
|
||||
@@ -7,83 +8,112 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: x86_64-unknown-linux-gnu
|
||||
|
||||
- name: Cache Cargo registry
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-
|
||||
key: linux-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Build for Linux
|
||||
- name: Build Linux (glibc)
|
||||
run: cargo build --release --target x86_64-unknown-linux-gnu
|
||||
|
||||
- name: Copy Linux executable
|
||||
- name: Copy executable
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cp target/x86_64-unknown-linux-gnu/release/http-rs artifacts/http-rs-linux-x86_64
|
||||
|
||||
- name: Upload Linux artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: http-rs-linux-x86_64
|
||||
path: artifacts/http-rs-linux-x86_64
|
||||
if-no-files-found: error
|
||||
|
||||
build-windows:
|
||||
|
||||
build-linux-musl:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install musl tools
|
||||
run: sudo apt-get update && sudo apt-get install -y musl-tools
|
||||
|
||||
- name: Install Rust
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: x86_64-pc-windows-gnu
|
||||
targets: x86_64-unknown-linux-musl
|
||||
|
||||
- name: Install MinGW cross-compiler
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-mingw-w64-x86-64
|
||||
|
||||
- name: Cache Cargo registry
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-windows-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-windows-
|
||||
key: musl-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Build for Windows
|
||||
- name: Build static binary
|
||||
run: cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
- name: Copy executable
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cp target/x86_64-unknown-linux-musl/release/http-rs artifacts/http-rs-linux-musl-x86_64
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: http-rs-linux-musl-x86_64
|
||||
path: artifacts/http-rs-linux-musl-x86_64
|
||||
|
||||
|
||||
build-windows:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-pc-windows-gnu
|
||||
|
||||
- name: Install MinGW
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-mingw-w64-x86-64
|
||||
|
||||
- name: Cache Cargo
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: windows-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Build Windows
|
||||
run: cargo build --release --target x86_64-pc-windows-gnu
|
||||
|
||||
- name: Copy Windows executable
|
||||
- name: Copy executable
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cp target/x86_64-pc-windows-gnu/release/http-rs.exe artifacts/http-rs-windows-x86_64.exe
|
||||
|
||||
- name: Upload Windows artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: http-rs-windows-x86_64
|
||||
path: artifacts/http-rs-windows-x86_64.exe
|
||||
if-no-files-found: error
|
||||
|
||||
Reference in New Issue
Block a user