diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61aa0d8..51c47ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: # make: bash scripts/build-macos.sh # package: bash scripts/package-macos.sh - target: linux - os: ubuntu-latest + os: ubuntu-22.04 make: bash scripts/package-linux.sh package artifact_path: | echo "ARTIFACT_PATH=$(bash scripts/package-linux.sh archive_path)" >> "$GITHUB_ENV" @@ -34,15 +34,30 @@ jobs: environment: signing steps: - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - uses: DeterminateSystems/flake-checker-action@main +# - uses: DeterminateSystems/nix-installer-action@main +# - uses: DeterminateSystems/magic-nix-cache-action@main +# - uses: DeterminateSystems/flake-checker-action@main - uses: Swatinem/rust-cache@v2 with: env-vars: CARGO USE_VENDOR_FEATURE + - name: Install linux deps + if: matrix.target.target == 'linux' + run: | + sudo apt update + sudo apt install \ + build-essential \ + git \ + pkg-config \ + libdbus-1-dev \ + libsqlcipher-dev \ + libudev-dev \ + libxkbcommon-dev \ + libfontconfig1-dev \ + libasound2-dev + - name: Build - run: nix develop --command bash -c "${{ matrix.target.make }}" + run: ${{ matrix.target.make }} - name: Sign macOS if: matrix.target.target == 'macos' @@ -57,6 +72,7 @@ jobs: run: nix develop --command bash -c "scripts/sign-macos.sh" - name: Package DMG + if: matrix.target.target == 'macos' run: nix develop --command bash -c "${{ matrix.target.package }}" - name: Set artifact path diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index f0c6eb4..dc65cef 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e # Exit on any error TARGET="harbor-ui" ARCH="x86_64" @@ -9,9 +10,8 @@ VERSION=$(grep -m1 '^version = ' harbor-ui/Cargo.toml | cut -d '"' -f2) ARCHIVE_NAME="$TARGET-$VERSION-$ARCH-linux.tar.gz" ARCHIVE_PATH="$RELEASE_DIR/$ARCHIVE_NAME" - build() { - cargo build --release --target=x86_64-unknown-linux-gnu -p harbor-ui + cargo build --release --target=x86_64-unknown-linux-gnu --features vendored -p harbor-ui } archive_name() { @@ -23,7 +23,7 @@ archive_path() { } package() { - build + build || { echo "Build failed"; exit 1; } # Explicit error handling for build install -Dm755 target/x86_64-unknown-linux-gnu/release/$TARGET -t $ARCHIVE_DIR/bin install -Dm644 $ASSETS_DIR/linux/cash.harbor.harbor.appdata.xml -t $ARCHIVE_DIR/share/metainfo