Release XenSQL #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.26' | |
| - 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') }} |