-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (136 loc) · 4.97 KB
/
Copy pathbuild.yml
File metadata and controls
160 lines (136 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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