Skip to content

v1.3.0 - 2026-04-01 #15

v1.3.0 - 2026-04-01

v1.3.0 - 2026-04-01 #15

Workflow file for this run

name: Release Packages
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.target_os }}-${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
env:
# Use Node.js 24 to run JavaScript actions and avoid Node 20 deprecation warnings.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
FFMPEG_BASE_URL: https://dl.liangbm3.site/downloads/ffmpeg
FFMPEG_TOKEN: ${{ secrets.FFMPEG_TOKEN }}
TARGET_OS: ${{ matrix.target_os }}
TARGET_ARCH: ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
target_os: linux
arch: amd64
- runner: ubuntu-24.04-arm
target_os: linux
arch: arm64
- runner: macos-latest
target_os: darwin
arch: amd64
- runner: macos-latest
target_os: darwin
arch: arm64
- runner: windows-latest
target_os: windows
arch: amd64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.x"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install Linux build deps
if: matrix.target_os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install NSIS
if: matrix.target_os == 'windows'
shell: powershell
run: |
choco install -y nsis
$nsisPath = "C:\Program Files (x86)\NSIS"
if (Test-Path $nsisPath) {
$nsisPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
- name: Install Wails and Task
shell: bash
run: |
go install github.com/wailsapp/wails/v3/cmd/wails3@latest
go install github.com/go-task/task/v3/cmd/task@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Sync version
shell: bash
run: |
task sync:version
- name: Resolve package version
shell: bash
run: |
if [ "${GITHUB_EVENT_NAME}" = "release" ] && [ -n "${GITHUB_REF_NAME}" ]; then
raw="${GITHUB_REF_NAME}"
elif [ "${GITHUB_REF_TYPE}" = "tag" ] && [ -n "${GITHUB_REF_NAME}" ]; then
raw="${GITHUB_REF_NAME}"
elif [ -f "VERSION" ]; then
raw="$(tr -d ' \n\r' < VERSION)"
else
raw="dev-${GITHUB_SHA::7}"
fi
version="${raw#v}"
echo "PACKAGE_VERSION=${version}" >> "$GITHUB_ENV"
echo "Resolved package version: ${version}"
- name: Build packages (no ffmpeg)
shell: bash
run: |
task package:no-ffmpeg ARCH="${TARGET_ARCH}"
- name: Collect artifacts (no ffmpeg)
shell: bash
run: |
mkdir -p dist
shopt -s nullglob
version="${PACKAGE_VERSION}"
suffix="no-ffmpeg"
if [ "${TARGET_OS}" = "windows" ]; then
for f in bin/AI-ViewNote-*-installer.exe; do
base=$(basename "$f")
cp "$f" "dist/${base%.exe}-${version}-${suffix}.exe"
done
elif [ "${TARGET_OS}" = "darwin" ]; then
if [ -d "bin/AI-ViewNote.app" ]; then
ditto -c -k --sequesterRsrc --keepParent "bin/AI-ViewNote.app" "dist/AI-ViewNote-macos-${TARGET_ARCH}-${version}-${suffix}.app.zip"
fi
else
for f in bin/*.AppImage; do
base=$(basename "$f")
cp "$f" "dist/${base%.AppImage}-${version}-${suffix}-${TARGET_ARCH}.AppImage"
done
for f in bin/*.deb; do
base=$(basename "$f")
cp "$f" "dist/${base%.deb}-${version}-${suffix}-${TARGET_ARCH}.deb"
done
for f in bin/*.rpm; do
base=$(basename "$f")
cp "$f" "dist/${base%.rpm}-${version}-${suffix}-${TARGET_ARCH}.rpm"
done
for f in bin/*.pkg.tar.zst; do
base=$(basename "$f")
cp "$f" "dist/${base%.pkg.tar.zst}-${version}-${suffix}-${TARGET_ARCH}.pkg.tar.zst"
done
fi
- name: Clean package outputs
shell: bash
run: |
shopt -s nullglob
rm -rf "bin/AI-ViewNote.app"
rm -f \
bin/AI-ViewNote \
bin/AI-ViewNote.exe \
bin/*.AppImage \
bin/*.deb \
bin/*.rpm \
bin/*.pkg.tar.zst \
bin/AI-ViewNote-*-installer.exe \
bin/*.msix \
bin/ffmpeg \
bin/ffmpeg.exe
- name: Build packages (with ffmpeg)
shell: bash
run: |
mkdir -p bin
if [ "${TARGET_OS}" = "windows" ]; then
ffmpeg_name="ffmpeg-windows-${TARGET_ARCH}.exe"
else
ffmpeg_name="ffmpeg-${TARGET_OS}-${TARGET_ARCH}"
fi
curl -fL -H "X-Download-Token: ${FFMPEG_TOKEN}" "${FFMPEG_BASE_URL}/${ffmpeg_name}" -o "bin/${ffmpeg_name}"
task package:with-ffmpeg ARCH="${TARGET_ARCH}" NFPM_CONFIG=./build/linux/nfpm/nfpm-with-ffmpeg.yaml
- name: Collect artifacts (with ffmpeg)
shell: bash
run: |
mkdir -p dist
shopt -s nullglob
version="${PACKAGE_VERSION}"
suffix="ffmpeg"
if [ "${TARGET_OS}" = "windows" ]; then
for f in bin/AI-ViewNote-*-installer.exe; do
base=$(basename "$f")
cp "$f" "dist/${base%.exe}-${version}-${suffix}.exe"
done
elif [ "${TARGET_OS}" = "darwin" ]; then
if [ -d "bin/AI-ViewNote.app" ]; then
ditto -c -k --sequesterRsrc --keepParent "bin/AI-ViewNote.app" "dist/AI-ViewNote-macos-${TARGET_ARCH}-${version}-${suffix}.app.zip"
fi
else
for f in bin/*.AppImage; do
base=$(basename "$f")
cp "$f" "dist/${base%.AppImage}-${version}-${suffix}-${TARGET_ARCH}.AppImage"
done
for f in bin/*.deb; do
base=$(basename "$f")
cp "$f" "dist/${base%.deb}-${version}-${suffix}-${TARGET_ARCH}.deb"
done
for f in bin/*.rpm; do
base=$(basename "$f")
cp "$f" "dist/${base%.rpm}-${version}-${suffix}-${TARGET_ARCH}.rpm"
done
for f in bin/*.pkg.tar.zst; do
base=$(basename "$f")
cp "$f" "dist/${base%.pkg.tar.zst}-${version}-${suffix}-${TARGET_ARCH}.pkg.tar.zst"
done
fi
- name: Upload release assets
uses: softprops/action-gh-release@v2
if: github.event_name == 'release'
with:
files: dist/**
- name: Upload artifacts (manual)
uses: actions/upload-artifact@v4
if: github.event_name == 'workflow_dispatch'
with:
name: dist-${{ matrix.target_os }}-${{ matrix.arch }}
path: dist/**