Skip to content

feat: uploads sync #141

feat: uploads sync

feat: uploads sync #141

Workflow file for this run

name: Build
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# Linux
- name: linux-amd64
runs_on: ubuntu-24.04
platform: linux/amd64
wails_tags: webkit2_41
- name: linux-arm64
runs_on: ubuntu-24.04-arm
platform: linux/arm64
wails_tags: webkit2_41
# macOS
- name: macos-arm64
runs_on: macos-15
platform: darwin/arm64
wails_tags: ""
- name: macos-amd64
runs_on: macos-15-intel
platform: darwin/amd64
wails_tags: ""
# Windows
- name: windows-amd64
runs_on: windows-latest
platform: windows/amd64
wails_tags: ""
- name: windows-arm64
runs_on: windows-11-arm
platform: windows/arm64
wails_tags: ""
runs-on: ${{ matrix.runs_on }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: true
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
libgtk-3-dev \
libwebkit2gtk-4.1-dev
- name: Install Wails CLI
# v2.12.0
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@ebe9d32e170905ff726a3bbb3d0076282e4edc41
- name: Build (Wails)
shell: bash
run: |
set -euo pipefail
if [ -n "${{ matrix.wails_tags }}" ]; then
wails build -clean -platform "${{ matrix.platform }}" -tags "${{ matrix.wails_tags }}"
else
wails build -clean -platform "${{ matrix.platform }}"
fi
- name: Build (Wails)
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
go install github.com/wailsapp/wails/v2/cmd/wails@ebe9d32e170905ff726a3bbb3d0076282e4edc41
wails build -clean -platform "${{ matrix.platform }}" -tags webkit2_41
#- name: Package AppImage
# if: runner.os == 'Linux'
# shell: bash
# run: |
# set -euo pipefail
# APP_NAME="elabftw-desktop"
# BIN="build/bin/${APP_NAME}"
# # Create AppDir skeleton
# APPDIR="AppDir"
# mkdir -p "${APPDIR}/usr/bin"
# cp "${BIN}" "${APPDIR}/usr/bin/${APP_NAME}"
# # Desktop file + icon (adjust paths if your icon lives elsewhere)
# cat > "${APP_NAME}.desktop" << 'EOF'
# [Desktop Entry]
# Type=Application
# Name=elabftw-desktop
# Exec=elabftw-desktop
# Icon=elabftw-desktop
# Categories=Utility;
# EOF
# # Add icon
# cp "frontend/src/assets/images/elabftw-logo.png" "${APP_NAME}.png"
# # Download linuxdeploy + GTK plugin (arch-specific)
# if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
# LD_BIN="linuxdeploy-x86_64.AppImage"
# GTK_PLUGIN="linuxdeploy-plugin-gtk-x86_64.AppImage"
# else
# LD_BIN="linuxdeploy-aarch64.AppImage"
# GTK_PLUGIN="linuxdeploy-plugin-gtk-aarch64.AppImage"
# fi
# curl -L -o "${LD_BIN}" "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/${LD_BIN}"
# curl -L -o "${GTK_PLUGIN}" "https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/releases/download/continuous/${GTK_PLUGIN}"
# chmod +x "${LD_BIN}" "${GTK_PLUGIN}"
# # On Ubuntu 24.04+ stripping can break due to modern ELF relr sections
# # Disabling strip avoids that. (Safe default in CI.)
# export NO_STRIP=1
# # Make the plugin discoverable for linuxdeploy
# export LINUXDEPLOY_PLUGINS=gtk
# export LINUXDEPLOY_PLUGIN_GTK_FILE="${PWD}/${GTK_PLUGIN}"
# "./${LD_BIN}" \
# --appdir "${APPDIR}" \
# --executable "${APPDIR}/usr/bin/${APP_NAME}" \
# --desktop-file "${APP_NAME}.desktop" \
# --icon-file "${APP_NAME}.png" \
# --plugin gtk \
# --output appimage
# ls -la ./*.AppImage
#- name: Upload AppImage
# if: runner.os == 'Linux'
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.name }}-appimage
# path: ./*.AppImage
# if-no-files-found: error
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.name }}
path: build/bin/**
if-no-files-found: error