Automatically build debs
This commit is contained in:
parent
62e1bdb1c0
commit
5d8919e2b5
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@ -11,7 +11,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
name: Run Tests
|
name: Build & Test
|
||||||
|
|
||||||
# Use a build matrix to run this job targeting all supported platforms
|
# Use a build matrix to run this job targeting all supported platforms
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -33,6 +33,12 @@ jobs:
|
|||||||
toolchain: ${{ matrix.rust_channel }}
|
toolchain: ${{ matrix.rust_channel }}
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
|
- name: Install cargo-deb
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: install
|
||||||
|
args: cargo-deb
|
||||||
|
|
||||||
- name: Compile
|
- name: Compile
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
@ -46,3 +52,16 @@ jobs:
|
|||||||
use-cross: true
|
use-cross: true
|
||||||
command: test
|
command: test
|
||||||
args: --all --release --target ${{ matrix.target }}
|
args: --all --release --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Package DEB
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
use-cross: false
|
||||||
|
command: deb
|
||||||
|
args: --target ${{ matrix.target }} --no-build
|
||||||
|
|
||||||
|
- name: Upload DEB
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: debian-packages
|
||||||
|
path: target/${{ matrix.target }}/debian/*.deb
|
||||||
|
17
Makefile
17
Makefile
@ -1,17 +0,0 @@
|
|||||||
# All sources used to build the protomask binary
|
|
||||||
SRC = Cargo.toml $(shell find src/ -type f -name '*.rs') $(shell find protomask-tun/src/ -type f -name '*.rs')
|
|
||||||
|
|
||||||
# Used to auto-version things
|
|
||||||
CRATE_VERSION = $(shell sed -n -r "s/^version = \"([0-9\.]+)\"/\1/p" Cargo.toml)
|
|
||||||
|
|
||||||
target/x86_64-unknown-linux-musl/release/protomask: $(SRC)
|
|
||||||
cross build --target x86_64-unknown-linux-musl --release
|
|
||||||
|
|
||||||
target/aarch64-unknown-linux-musl/release/protomask: $(SRC)
|
|
||||||
cross build --target aarch64-unknown-linux-musl --release
|
|
||||||
|
|
||||||
target/x86_64-unknown-linux-musl/debian/protomask_${CRATE_VERSION}_amd64.deb: target/x86_64-unknown-linux-musl/release/protomask
|
|
||||||
cargo deb --target x86_64-unknown-linux-musl --no-build
|
|
||||||
|
|
||||||
target/aarch64-unknown-linux-musl/debian/protomask_${CRATE_VERSION}_arm64.deb: target/aarch64-unknown-linux-musl/release/protomask
|
|
||||||
cargo deb --target aarch64-unknown-linux-musl --no-build
|
|
Loading…
x
Reference in New Issue
Block a user