Skip to content

fix(spells): backfill spell_icons from complete DBC mapping #9

fix(spells): backfill spell_icons from complete DBC mapping

fix(spells): backfill spell_icons from complete DBC mapping #9

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Build and Release
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
platform: windows/amd64
artifact: InkLab-Windows.zip
build_tags: ""
- os: ubuntu-latest
platform: linux/amd64
artifact: InkLab-Linux.tar.gz
build_tags: "-tags webkit2_41"
- os: macos-latest
platform: darwin/universal
artifact: InkLab-macOS.zip
build_tags: ""
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: false
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Linux Dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.11.0
- name: Install Frontend Dependencies
working-directory: frontend
run: npm install
- name: Set build version
shell: bash
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
node -e "const fs=require('fs');const j=JSON.parse(fs.readFileSync('wails.json'));j.info.productVersion='$VERSION';fs.writeFileSync('wails.json',JSON.stringify(j,null,4)+'\n');"
echo "Set wails.json productVersion to $VERSION"
- name: Build
run: wails build -platform ${{ matrix.platform }} -skipbindings ${{ matrix.build_tags }} -ldflags "-X main.Version=${{ github.ref_name }} -X main.Repo=${{ github.repository }}"
# --- Windows Packaging ---
- name: Package Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path "dist/data/icons"
Copy-Item "build/bin/InkLab.exe" -Destination "dist/"
# Database is embedded, no need to copy external file
# Copy initial icons if any
if (Test-Path "data/icons") {
Copy-Item "data/icons/*" -Destination "dist/data/icons/" -Recurse
}
# Copy NPC images
New-Item -ItemType Directory -Force -Path "dist/data/npc_images"
if (Test-Path "data/npc_images") {
Copy-Item "data/npc_images/*" -Destination "dist/data/npc_images/" -Recurse
}
Compress-Archive -Path "dist/*" -DestinationPath "InkLab-Windows.zip"
# --- Linux Packaging ---
- name: Package Linux
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p dist/data/icons
cp build/bin/InkLab dist/
# db embedded
if [ -d "data/icons" ]; then
cp -r data/icons/* dist/data/icons/
fi
# Copy NPC images
mkdir -p dist/data/npc_images
if [ -d "data/npc_images" ]; then
cp -r data/npc_images/* dist/data/npc_images/
fi
cd dist
tar -czvf ../InkLab-Linux.tar.gz *
cd ..
# --- macOS Packaging ---
- name: Package macOS
if: matrix.os == 'macos-latest'
run: |
# Copy data into app bundle MacOS directory (alongside binary) for unified path logic
mkdir -p build/bin/InkLab.app/Contents/MacOS/data/icons
# db embedded
if [ -d "data/icons" ]; then
cp -r data/icons/* build/bin/InkLab.app/Contents/MacOS/data/icons/
fi
# Copy NPC images
mkdir -p build/bin/InkLab.app/Contents/MacOS/data/npc_images
if [ -d "data/npc_images" ]; then
cp -r data/npc_images/* build/bin/InkLab.app/Contents/MacOS/data/npc_images/
fi
cd build/bin
ditto -c -k --sequesterRsrc --keepParent InkLab.app InkLab.app.zip
mv InkLab.app.zip ../../InkLab-macOS.zip
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.artifact }}
draft: false
prerelease: false
generate_release_notes: true