1
0
mirror of https://github.com/chylex/Bark-Browser.git synced 2025-05-08 13:34:04 +02:00

Add build scripts

This commit is contained in:
chylex 2023-08-03 18:54:29 +02:00
parent 4930a5b08c
commit 7519472a43
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
4 changed files with 45 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/.idea/
/out/
/target/

View File

@ -2,10 +2,10 @@ FROM rust:1.71.0 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
RUN ./scripts/build.sh
FROM scratch as exporter
COPY --from=builder /app/target/release/bark .
COPY --from=builder /app/out/ .
# docker build --output out .

22
scripts/build.ps1 Normal file
View File

@ -0,0 +1,22 @@
Set-Location (Split-Path $PSScriptRoot -Parent)
if (!(Test-Path "out")) {
mkdir "out"
}
cargo build --release
$version = & "target\release\bark.exe" --version
$arch = switch ((Get-WMIObject -Class Win32_Processor).Architecture) {
0 { "x86" }
1 { "mips" }
2 { "alpha" }
3 { "ppc" }
5 { "arm" }
6 { "ia64" }
9 { "x64" }
12 { "arm64" }
DEFAULT { "unknown" }
}
Compress-Archive -Force -Path "target\release\bark.exe" -DestinationPath "out\bark-${version}-windows-${arch}.zip"

20
scripts/build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
cd ..
mkdir -p out
cargo build --release
cd target/release
VERSION=$(./bark --version)
ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]]; then
ARCH="x64"
elif [[ "$ARCH" == "aarch64" ]]; then
ARCH="arm64"
fi
tar czf "../../out/bark-${VERSION}-linux-${ARCH}.tar.gz" --owner=0 --group=0 -- bark