Skip to content

Commit

Permalink
Merge pull request #234 from vsimakhin/feature/binaries-for-old-arm
Browse files Browse the repository at this point in the history
add support for v6 and v7 ARM32
  • Loading branch information
vsimakhin authored Jun 1, 2024
2 parents 17ccfa1 + 0cabc85 commit 4651c63
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 18 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/web-logbook-linux-arm64.tar.gz

- name: Upload Linux ARM32
- name: Upload Linux ARM32 v6
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/web-logbook-linux-arm.tar.gz
asset_path: dist/web-logbook-linux-arm-6.tar.gz

- name: Upload Linux ARM32 v7
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/web-logbook-linux-arm-7.tar.gz

- name: Upload Window AMD64
uses: shogo82148/actions-upload-release-asset@v1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Update: Slightly updated the build script to support v6 and v7 platforms for ARM32 binaries.
- New: Added new option to the Settings page - `Do not adjust logbook columns for small screens`. In this case the full logbook table will be shown without hiding any columns for mobile devices.
- New: New stats page - Totals by Month

Expand Down
67 changes: 51 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ XC_OS ?= linux darwin windows
XC_ARCH ?= amd64 arm64 arm
BIN="./dist"
BINARY_NAME="web-logbook"
OPTIONS=-ldflags="-s -w" -trimpath

## clean: cleans all binaries and runs go clean
clean:
Expand Down Expand Up @@ -35,19 +36,53 @@ start_tls: build
@echo "Starting the app with https enabled..."
@env ./dist/web-logbook -port=${PORT} -env="${ENV}" -enable-https

build_all: test clean
@echo "Building everything..."
@for OS in $(XC_OS); do \
for ARCH in $(XC_ARCH); do \
[ $$OS = "windows" ] && [ $$ARCH = "arm64" ] && continue; \
[ $$OS != "linux" ] && [ $$ARCH = "arm" ] && continue; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH; \
CGO_ENABLED=0 \
GOOS=$$OS \
GOARCH=$$ARCH \
go build -ldflags="-s -w" -trimpath \
-o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) ./app; \
[ $$OS = "windows" ] && (cd $(BIN); mv $(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) $(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME).exe; zip -r $(BINARY_NAME)-$$OS-$$ARCH.zip $(BINARY_NAME)-$$OS-$$ARCH; cd ../) \
|| (cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH.tar.gz $(BINARY_NAME)-$$OS-$$ARCH; cd ../) ;\
done ; \
done
build_linux_amd64:
@OS=linux; ARCH=amd64; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) ./app; \
cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH.tar.gz $(BINARY_NAME)-$$OS-$$ARCH;

build_linux_arm64:
@OS=linux; ARCH=arm64; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) ./app; \
cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH.tar.gz $(BINARY_NAME)-$$OS-$$ARCH;

build_linux_arm_6:
@OS=linux; ARCH=arm; ARM=6; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH-$$ARM; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH GOARM=$$ARM \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH-$$ARM/$(BINARY_NAME) ./app; \
cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH-$$ARM.tar.gz $(BINARY_NAME)-$$OS-$$ARCH-$$ARM;

build_linux_arm_7:
@OS=linux; ARCH=arm; ARM=7; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH-$$ARM; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH GOARM=$$ARM \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH-$$ARM/$(BINARY_NAME) ./app; \
cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH-$$ARM.tar.gz $(BINARY_NAME)-$$OS-$$ARCH-$$ARM;

build_darwin_amd64:
@OS=darwin; ARCH=amd64; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) ./app; \
cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH.tar.gz $(BINARY_NAME)-$$OS-$$ARCH;

build_darwin_arm64:
@OS=darwin; ARCH=arm64; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) ./app; \
cd $(BIN); tar czf $(BINARY_NAME)-$$OS-$$ARCH.tar.gz $(BINARY_NAME)-$$OS-$$ARCH;

build_windows_amd64:
@OS=windows; ARCH=amd64; \
echo Building $$OS/$$ARCH to $(BIN)/$(BINARY_NAME)-$$OS-$$ARCH; \
CGO_ENABLED=0 GOOS=$$OS GOARCH=$$ARCH \
go build $(OPTIONS) -o=$(BIN)/$(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) ./app; \
cd $(BIN); mv $(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME) $(BINARY_NAME)-$$OS-$$ARCH/$(BINARY_NAME).exe; zip -r $(BINARY_NAME)-$$OS-$$ARCH.zip $(BINARY_NAME)-$$OS-$$ARCH;

build_all: test clean build_linux_amd64 build_linux_arm64 build_linux_arm_6 build_linux_arm_7 build_darwin_amd64 build_darwin_arm64 build_windows_amd64
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You also can easily export all flight records into EASA style pdf format, print

## [Unreleased]

- Update: Slightly updated the build script to support v6 and v7 platforms for ARM32 binaries.
- New: Added new option to the Settings page - `Do not adjust logbook columns for small screens`. In this case the full logbook table will be shown without hiding any columns for mobile devices.
- New: New stats page - Totals by Month

Expand Down

0 comments on commit 4651c63

Please sign in to comment.