Repository navigation
172 lines (151 loc) · 5.66 KB
/
Copy pathrelease.yml
File metadata and controls
172 lines (151 loc) · 5.66 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
161
162
163
164
165
166
167
168
169
170
171
172
name: Release XenSQL
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Release tag (required), e.g. v1.1.2'
required: true
type: string
permissions:
contents: write
env:
NODE_OPTIONS: '--max-old-space-size=4096'
jobs:
build:
strategy:
matrix:
build:
- os: ubuntu-latest
platform: linux/amd64
- os: windows-latest
platform: windows/amd64
- os: macos-latest
platform: darwin/universal
runs-on: ${{ matrix.build.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.27'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install Linux dependencies
if: matrix.build.platform == 'linux/amd64'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-4-dev libwebkitgtk-6.0-dev libglib2.0-dev pkg-config gcc
- name: Install Wails3 CLI
shell: bash
run: |
go install github.com/wailsapp/wails/v3/cmd/wails3@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
# The updater matches an asset by filename (GOOS+GOARCH) and unpacks a
# single top-level entry, so each archive is named <platform>-<arch> and
# holds exactly one entry: the binary (linux/windows) or XenSQL.app (macOS).
# Plain XenSQL / XenSQL.exe (no platform tokens), distro packages
# (XenSQL.deb, XenSQL.rpm, XenSQL.pkg.tar.zst, xensql-x86_64.AppImage) and
# XenSQL-amd64-installer.exe are manual-download only.
- name: Build & package (Linux)
if: matrix.build.platform == 'linux/amd64'
shell: bash
env:
APPIMAGE_EXTRACT_AND_RUN: 1
run: |
set -euo pipefail
wails3 package GOOS=linux
mkdir -p dist
# Auto-updater asset
tar -C bin -czf "dist/XenSQL-linux-amd64.tar.gz" XenSQL
# Manual downloads (updater skips - no GOOS/GOARCH in filenames)
cp bin/XenSQL bin/XenSQL.deb bin/XenSQL.rpm bin/XenSQL.pkg.tar.zst bin/xensql-x86_64.AppImage dist/
- name: Install NSIS
if: matrix.build.platform == 'windows/amd64'
uses: negrutiu/nsis-install@v2
- name: Build & package (Windows)
if: matrix.build.platform == 'windows/amd64'
shell: pwsh
run: |
wails3 package GOOS=windows
New-Item -ItemType Directory -Force -Path dist | Out-Null
Compress-Archive -Path bin/XenSQL.exe -DestinationPath dist/XenSQL-windows-amd64.zip -Force
Copy-Item bin/XenSQL.exe, bin/XenSQL-amd64-installer.exe dist/
- name: Build & package (macOS)
if: matrix.build.platform == 'darwin/universal'
shell: bash
run: |
set -euo pipefail
wails3 task darwin:package:universal # -> bin/XenSQL.app (universal)
mkdir -p dist
# Plain `zip` keeps XenSQL.app as the sole top-level entry (no __MACOSX/._).
# The universal app runs on both arches, so publish it under both names.
( cd bin && zip -r -y -X "../dist/XenSQL-darwin-arm64.zip" "XenSQL.app" >/dev/null )
cp "dist/XenSQL-darwin-arm64.zip" "dist/XenSQL-darwin-amd64.zip"
# .dmg for manual installs; no darwin/arch tokens, so the updater skips it.
hdiutil create -volname "XenSQL" -srcfolder "bin/XenSQL.app" -ov -format UDZO "dist/XenSQL-macos-universal.dmg"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.build.os }}
path: dist/*
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- name: Resolve release tag
id: release
shell: bash
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.version }}"
if [ -z "${TAG// /}" ]; then
echo "::error::Version tag is required for manual releases."
exit 1
fi
elif [ "${{ github.ref_type }}" = "tag" ]; then
TAG="${{ github.ref_name }}"
else
echo "::error::Release job expects a v* tag push or workflow_dispatch with a version."
exit 1
fi
if [[ ! "$TAG" =~ ^v ]]; then
echo "::error::Release tag must start with 'v' (got: $TAG)"
exit 1
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Generate SHA256SUMS
shell: bash
working-directory: dist
run: |
set -euo pipefail
# Updater verifies its picked asset against its line here.
sha256sum * > SHA256SUMS
cat SHA256SUMS
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release.outputs.tag }}
name: XenSQL ${{ steps.release.outputs.tag }}
files: dist/*
generate_release_notes: true
draft: false
prerelease: ${{ contains(steps.release.outputs.tag, 'beta') || contains(steps.release.outputs.tag, 'rc') }}