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:
parent
4930a5b08c
commit
7519472a43
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
/.idea/
|
||||
/out/
|
||||
/target/
|
||||
|
@ -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
22
scripts/build.ps1
Normal 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
20
scripts/build.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user