Improve Build workflow to generate .deb pkg
This commit is contained in:
parent
55f426d99a
commit
a1640b54d8
1 changed files with 58 additions and 23 deletions
81
.github/workflows/build.yml
vendored
81
.github/workflows/build.yml
vendored
|
|
@ -4,39 +4,74 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
todos:
|
todos_linux:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
||||||
rust: [stable]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: hecrj/setup-rust-action@v1
|
- uses: hecrj/setup-rust-action@v1
|
||||||
with:
|
- name: Install cargo-deb
|
||||||
rust-version: ${{ matrix.rust }}
|
run: cargo install cargo-deb
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Enable Link Time Optimizations
|
- name: Enable Link Time Optimizations and strip debug symbols
|
||||||
run: |
|
run: |
|
||||||
echo "[profile.release]" >> Cargo.toml
|
echo "[profile.release]" >> Cargo.toml
|
||||||
echo "lto = true" >> Cargo.toml
|
echo "lto = true" >> Cargo.toml
|
||||||
- name: Build todos example
|
echo "debug = false" >> Cargo.toml
|
||||||
|
- name: Add .deb package metadata
|
||||||
run: |
|
run: |
|
||||||
cargo build --verbose --release --example todos
|
echo '[package.metadata.deb.variants.todos]' >> Cargo.toml
|
||||||
- name: Archive todos binary (Windows)
|
echo 'extended-description = "A simple Todo app built with Iced, a cross-platform GUI library for Rust"' >> Cargo.toml
|
||||||
if: matrix.os == 'windows-latest'
|
echo 'assets = [["target/release/examples/todos", "usr/bin/", "755"]]' >> Cargo.toml
|
||||||
|
- name: Build todos binary
|
||||||
|
run: cargo build --verbose --release --locked --example todos
|
||||||
|
- name: Build todos .deb package
|
||||||
|
run: cargo deb --variant todos -- --locked --example todos
|
||||||
|
- name: Rename todos .deb package
|
||||||
|
run: mv target/debian/*.deb target/debian/iced_todos-x86_64-debian-linux-gnu.deb
|
||||||
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-windows
|
name: todos-x86_64-unknown-linux-gnu
|
||||||
|
path: target/release/examples/todos
|
||||||
|
- name: Archive todos .deb package
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: todos-x86_64-debian-linux-gnu
|
||||||
|
path: target/debian/iced_todos-x86_64-debian-linux-gnu.deb
|
||||||
|
|
||||||
|
todos_windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: hecrj/setup-rust-action@v1
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: Enable Link Time Optimizations and strip debug symbols
|
||||||
|
run: |
|
||||||
|
echo "[profile.release]" >> Cargo.toml
|
||||||
|
echo "lto = true" >> Cargo.toml
|
||||||
|
echo "debug = false" >> Cargo.toml
|
||||||
|
- name: Build todos binary
|
||||||
|
run: cargo build --verbose --release --locked --example todos
|
||||||
|
- name: Archive todos binary
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: todos-x86_64-pc-windows-msvc
|
||||||
path: target/release/examples/todos.exe
|
path: target/release/examples/todos.exe
|
||||||
- name: Archive todos binary (Linux)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
todos_macos:
|
||||||
|
runs-on: macOS-latest
|
||||||
|
steps:
|
||||||
|
- uses: hecrj/setup-rust-action@v1
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: Enable Link Time Optimizations and strip debug symbols
|
||||||
|
run: |
|
||||||
|
echo "[profile.release]" >> Cargo.toml
|
||||||
|
echo "lto = true" >> Cargo.toml
|
||||||
|
echo "debug = false" >> Cargo.toml
|
||||||
|
- name: Build todos binary
|
||||||
|
env:
|
||||||
|
MACOSX_DEPLOYMENT_TARGET: 10.7
|
||||||
|
run: cargo build --verbose --release --locked --example todos
|
||||||
|
- name: Archive todos binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: todos-linux
|
name: todos-x86_64-apple-darwin
|
||||||
path: target/release/examples/todos
|
|
||||||
- name: Archive todos binary (macOS)
|
|
||||||
if: matrix.os == 'macOS-latest'
|
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
|
||||||
name: todos-macos
|
|
||||||
path: target/release/examples/todos
|
path: target/release/examples/todos
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue