Skip to content

Commit

Permalink
no nix
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Feb 22, 2025
1 parent 03f6ad6 commit 6798d82
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,38 @@ 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"
runs-on: ${{ matrix.target.os }}
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'
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/package-linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e # Exit on any error

TARGET="harbor-ui"
ARCH="x86_64"
Expand All @@ -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() {
Expand All @@ -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
Expand Down

0 comments on commit 6798d82

Please sign in to comment.