mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 21:19:19 +00:00
Compare commits
4 Commits
efcb6f8bf0
...
5bf7647cba
Author | SHA1 | Date | |
---|---|---|---|
|
5bf7647cba | ||
|
f721034ae5 | ||
|
a32361fab2 | ||
|
572e489db6 |
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@ -57,6 +57,7 @@ jobs:
|
||||
with:
|
||||
version: 0.14.0
|
||||
- name: Build arm64 gui
|
||||
if: false
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
id: windows_arm64_gui
|
||||
@ -98,21 +99,21 @@ jobs:
|
||||
- name: Build amd64
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
id: windows_amd64
|
||||
cmd: make windows_amd64
|
||||
out: out/windows_amd64/yarr
|
||||
id: linux_amd64
|
||||
cmd: make linux_amd64
|
||||
out: out/linux_amd64/yarr
|
||||
- name: Build arm64
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
id: windows_arm64
|
||||
cmd: make windows_arm64
|
||||
out: out/windows_arm64/yarr
|
||||
id: linux_arm64
|
||||
cmd: make linux_arm64
|
||||
out: out/linux_arm64/yarr
|
||||
- name: Build armv7
|
||||
uses: ./.github/actions/prepare
|
||||
with:
|
||||
id: windows_armv7
|
||||
cmd: make windows_armv7
|
||||
out: out/windows_armv7/yarr
|
||||
id: linux_armv7
|
||||
cmd: make linux_armv7
|
||||
out: out/linux_armv7/yarr
|
||||
|
||||
create_release:
|
||||
name: Create Release
|
||||
|
32
doc/build.md
32
doc/build.md
@ -1,21 +1,33 @@
|
||||
## Compilation
|
||||
|
||||
Install `Go >= 1.17` and `GCC`. Get the source code:
|
||||
Prerequisies:
|
||||
|
||||
* Go >= 1.18
|
||||
* C Compiler (GCC / Clang / ...)
|
||||
* Zig >= 0.14.0 (optional, for cross-compiling CLI versions)
|
||||
* binutils (optional, for building Windows GUI version)
|
||||
|
||||
Get the source code:
|
||||
|
||||
git clone https://github.com/nkanaev/yarr.git
|
||||
|
||||
Then run one of the corresponding commands:
|
||||
Compile:
|
||||
|
||||
# create an executable for the host os
|
||||
make build_macos # -> _output/macos/yarr.app
|
||||
make build_linux # -> _output/linux/yarr
|
||||
make build_windows # -> _output/windows/yarr.exe
|
||||
# create cli for the host OS/architecture
|
||||
make host # out/yarr
|
||||
|
||||
# host-specific cli version (no gui)
|
||||
make build_default # -> _output/yarr
|
||||
# create GUI, works only in the target OS
|
||||
make windows_amd64_gui # out/windows_amd64_gui/yarr.exe
|
||||
make windows_arm64_gui # out/windows_arm64_gui/yarr.exe
|
||||
make darwin_arm64_gui # out/darwin_arm64_gui/yarr.app
|
||||
make darwin_amd64_gui # out/darwin_amd64_gui/yarr.app
|
||||
|
||||
# ... or start a dev server locally
|
||||
make serve # starts a server at http://localhost:7070
|
||||
# create cli, cross-compiles within any OS/architecture
|
||||
make linux_amd64
|
||||
make linux_arm64
|
||||
make linux_armv7
|
||||
make windows_amd64
|
||||
make windows_arm64
|
||||
|
||||
# ... or build a docker image
|
||||
docker build -t yarr -f etc/dockerfile .
|
||||
|
@ -3,12 +3,12 @@ RUN apk add build-base git
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/go/pkg \
|
||||
make build_linux
|
||||
make host
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk add --no-cache ca-certificates && \
|
||||
update-ca-certificates
|
||||
COPY --from=build /src/_output/linux/yarr /usr/local/bin/yarr
|
||||
COPY --from=build /src/out/yarr /usr/local/bin/yarr
|
||||
EXPOSE 7070
|
||||
ENTRYPOINT ["/usr/local/bin/yarr"]
|
||||
CMD ["-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"]
|
||||
|
@ -27,18 +27,12 @@ RUN env \
|
||||
CC=aarch64-linux-gnu-gcc \
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=linux GOARCH=arm64 \
|
||||
go build \
|
||||
-tags "sqlite_foreign_keys linux" \
|
||||
-ldflags="-s -w" \
|
||||
-o /root/out/yarr.arm64 ./cmd/yarr
|
||||
make host && mv out/yarr /root/out/yarr.arm64
|
||||
|
||||
RUN env \
|
||||
CC=arm-linux-gnueabihf-gcc \
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=linux GOARCH=arm GOARM=7 \
|
||||
go build \
|
||||
-tags "sqlite_foreign_keys linux" \
|
||||
-ldflags="-s -w" \
|
||||
-o /root/out/yarr.arm7 ./cmd/yarr
|
||||
make host && mv out/yarr /root/out/yarr.armv7
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
|
2
makefile
2
makefile
@ -68,7 +68,7 @@ darwin_amd64_gui: etc/icon.icns
|
||||
GOOS=darwin GOARCH=amd64 go build $(GO_FLAGS_GUI) -o out/$@/yarr ./cmd/yarr
|
||||
./etc/macos_package.sh $(VERSION) etc/icon.icns out/$@/yarr out/$@
|
||||
|
||||
windows_amd64_gui: windows_versioninfo
|
||||
windows_amd64_gui: src/platform/versioninfo.rc
|
||||
GOOS=windows GOARCH=amd64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr.exe ./cmd/yarr
|
||||
|
||||
windows_arm64_gui: src/platform/versioninfo.rc
|
||||
|
Loading…
x
Reference in New Issue
Block a user