Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,4 @@ jobs:
build-platform: ${{ matrix.build.platform }}
package: true
go-version: '1.23'

build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

79 changes: 42 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Wails build
name: Fyne build

on:
push:
Expand All @@ -10,6 +10,7 @@ env:
NODE_OPTIONS: "--max-old-space-size=4096"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
CGO_ENABLED: 1

jobs:
build:
Expand All @@ -19,57 +20,61 @@ jobs:
matrix:
build:
- name: 'gogallery'
platform: 'linux/amd64'
os: 'ubuntu-latest'
goos: 'linux'
goarch: 'amd64'
- name: 'gogallery'
platform: 'windows/amd64'
os: 'windows-latest'
goos: 'windows'
goarch: 'amd64'
- name: 'gogallery'
platform: 'darwin/universal'
os: 'macos-latest'
goos: 'darwin'
goarch: 'amd64'
- name: 'gogallery'
os: 'macos-latest'
goos: 'darwin'
goarch: 'arm64'

runs-on: ${{ matrix.build.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build wails
uses: dAppServer/[email protected]
id: build
- name: Set up Go
uses: actions/setup-go@v4
with:
build-name: ${{ matrix.build.name }}
build-platform: ${{ matrix.build.platform }}
package: false
go-version: '1.21'
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
go-version: '>=1.24.2'
check-latest: true

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Fyne dependencies (Ubuntu)
if: matrix.build.os == 'ubuntu-latest'
run: |
make fyne-deps-ubuntu

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Fyne dependencies (macOS)
if: matrix.build.os == 'macos-latest'
run: |
# macOS has the necessary frameworks built-in

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Install Fyne CLI
run: make fyne-cli

- name: Build Fyne app
env:
GOOS: ${{ matrix.build.goos }}
GOARCH: ${{ matrix.build.goarch }}
CGO_ENABLED: 1
shell: bash
run: |
make fyne-build

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
name: ${{ matrix.build.name }}-${{ matrix.build.goos }}-${{ matrix.build.goarch }}
path: |
${{ matrix.build.name }}*

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ temp
# production
/build

ui
.env
.sql

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

themes/**/package-lock.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"mode": "auto",
"cwd": "${workspaceFolder}",
"program": "main.go",
"args": ["dev"]
// "args": ["serve"]
}
]
}
27 changes: 0 additions & 27 deletions Dockerfile

This file was deleted.

File renamed without changes
75 changes: 50 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,66 @@ GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=../gogallery
BINARY_UNIX=$(BINARY_NAME)_unix
FYNE=fyne
BINARY_NAME=gogallery

ifndef CIRCLE_BRANCH
override CIRCLE_BRANCH = latest
else
override CIRCLE_BRANCH = $(shell git rev-parse --abbrev-ref HEAD | sed 's/[^a-zA-Z0-9]/-/g')
endif

all: clean test build
build-themes:
@echo "Building themes..."
@for theme in themes/*; do \
if [ -d "$$theme" ]; then \
echo "Building theme: $$theme"; \
cd "$$theme" && npm install && npm run build && npm run clean; \
cd -; \
fi; \
done

dep:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
build:
@echo "Building GoGallery..."
$(GOBUILD) -o $(BINARY_NAME) -v .

test:
cd server && $(GOTEST) -v ./...
# Cross-platform Fyne build (mimics CI logic)
.PHONY: fyne-build
fyne-build:
@echo "Building GoGallery with Fyne packaging..."
go mod download
@export GOOS=$(GOOS); export GOARCH=$(GOARCH); export CGO_ENABLED=1; \
if [ "$(GOOS)" = "windows" ]; then \
OUTPUT_NAME="$(BINARY_NAME).exe"; \
$(FYNE) package -os windows -name "$$OUTPUT_NAME" .; \
elif [ "$(GOOS)" = "darwin" ]; then \
$(FYNE) package -os darwin -name "$(BINARY_NAME).app" .; \
else \
OUTPUT_NAME="$(BINARY_NAME)"; \
$(FYNE) package -os linux -name "$$OUTPUT_NAME" .; \
fi

package:
tar -czvf gogallery-linux-amd64.tgz gogallery config_sample.yml ui
# Cross compilation
build-linux:
wails build -tags webkit2_41
build-windows:
CC=x86_64-w64-mingw32-gccGOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ wails build -skipbindings
# Install Fyne CLI
.PHONY: fyne-cli
fyne-cli:
$(GOCMD) install fyne.io/tools/cmd/fyne@latest

docker:
docker build . -t robrotheram/gogallery:$(CIRCLE_BRANCH)
docker build . -t robrotheram/gogallery:latest
docker-publish:
docker push robrotheram/gogallery:$(CIRCLE_BRANCH)
docker push robrotheram/gogallery:latest
# Install Fyne dependencies (Ubuntu)
.PHONY: fyne-deps-ubuntu
fyne-deps-ubuntu:
sudo apt-get update
sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev libxkbcommon-dev

install:
cp build/bin/gogallery /home/${HOME}/.local/bin/gogallery
# Install Fyne dependencies (RedHat/Fedora)
.PHONY: fyne-deps-fedora
fyne-deps-fedora:
sudo dnf install -y gcc mesa-libGL-devel libX11-devel libxkbcommon-devel

update:
go get -u
go mod tidy
# Build all (default)
.PHONY: all
all: fyne-cli fyne-build

# Clean
.PHONY: clean
clean:
rm -rf $(BINARY_NAME) $(BINARY_NAME).exe $(BINARY_NAME).app
Loading