Skip to content

Commit

Permalink
Build debian packages (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
demoray authored Jun 5, 2024
1 parent ed6fbf4 commit dc83218
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,36 @@ jobs:
fail-fast: false
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: ubuntu-22.04
os: ubuntu-22.04
- build: ubuntu-24.04
os: ubuntu-24.04
- build: macos
os: macos-latest
target: x86_64-apple-darwin
- build: win-msvc
- build: windows
os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: eng/build.sh ${{ matrix.target }}
- run: eng/build.sh
shell: bash
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: ${{ matrix.build }}
path: target/${{ matrix.target }}/release/az-pim.exe
path: target/release/az-pim.exe
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: matrix.os == 'macos-latest'
with:
name: ${{ matrix.build }}
path: target/release/az-pim
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
if: startsWith(matrix.os, 'ubuntu-')
with:
name: ${{ matrix.build }}
path: target/${{ matrix.target }}/release/az-pim
path: target/debian/*.deb
if-no-files-found: error
14 changes: 8 additions & 6 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

set -uvex -o pipefail

BUILD_TARGET=${1:-""}
BUILD_PROFILE=${2:-"release"}

cd $(dirname ${BASH_SOURCE[0]})/../

which typos || cargo install typos-cli

BUILD_COMMON="--locked --profile ${BUILD_PROFILE}"
if [ x"${BUILD_TARGET}" != x"" ]; then
BUILD_COMMON="${BUILD_COMMON} --target ${BUILD_TARGET}"
if [[ ${OSTYPE} == "linux-gnu"* ]]; then
which cargo-deb || cargo install cargo-deb
fi

BUILD_COMMON="--locked --profile release"

typos
cargo clippy ${BUILD_COMMON} --all-targets --all-features -- -D warnings -D clippy::pedantic -A clippy::missing_errors_doc -A clippy::module_name_repetitions
cargo clippy ${BUILD_COMMON} --tests --all-targets --all-features -- -D warnings
Expand All @@ -22,3 +20,7 @@ cargo build ${BUILD_COMMON}
cargo test ${BUILD_COMMON}
cargo run ${BUILD_COMMON} -- readme > README.md
git diff --exit-code README.md

if [[ ${OSTYPE} == "linux-gnu"* ]]; then
cargo deb
fi

0 comments on commit dc83218

Please sign in to comment.