654 lines
28 KiB
YAML
654 lines
28 KiB
YAML
name: Release Draft
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
|
|
build-webapp: # TODO Uncomment if building web
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
# Web
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
# outputs in "seanime-web/out/" and "seanime-web/out-desktop/"
|
|
- name: Install dependencies and build Next.js app
|
|
run: |
|
|
cd seanime-web/
|
|
npm install
|
|
npm run build
|
|
npm run build:desktop
|
|
cd ..
|
|
# Upload the output to be used in the next job
|
|
- name: Upload web folder
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web
|
|
path: seanime-web/out # output dir of build
|
|
- name: Upload web folder (desktop)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web-desktop
|
|
path: seanime-web/out-desktop # output dir of build:desktop
|
|
|
|
build-server:
|
|
needs: build-webapp # TODO Uncomment if building web
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
# 6 binaries: 2 for Windows, 2 for Linux, 2 for macOS
|
|
include:
|
|
# This is the systray version of the Windows binary used for the server build
|
|
- os: macos-latest # seanime-server-systray-windows.exe
|
|
id: seanime-server-systray-windows
|
|
go_flags: -trimpath -buildmode=exe -ldflags="-s -w -H=windowsgui -extldflags '-static'"
|
|
|
|
# This is the non-systray version of the Windows binary used for the Tauri Windows build
|
|
- os: windows-latest # seanime-server-windows.exe
|
|
id: seanime-server-windows
|
|
go_flags: -trimpath -ldflags="-s -w" -tags=nosystray
|
|
|
|
# These are the Linux binaries used for the server build and the Tauri Linux build
|
|
- os: ubuntu-latest # seanime-server-linux-arm64, seanime-server-linux-amd64
|
|
id: seanime-server-linux
|
|
go_flags: -trimpath -ldflags="-s -w"
|
|
|
|
# These are the macOS binaries used for the server build and the Tauri macOS build
|
|
- os: macos-latest # seanime-server-darwin-arm64, seanime-server-darwin-amd64
|
|
id: seanime-server-darwin
|
|
go_env: CGO_ENABLED=0
|
|
go_flags: -trimpath -ldflags="-s -w"
|
|
steps:
|
|
- name: Checkout code ⬇️
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Fetch all history
|
|
fetch-tags: true # Fetch all tags
|
|
set-safe-directory: true # Add repo path as safe.directory
|
|
|
|
- name: Fetch all tags # Fetch all tags (again? can't hurt)
|
|
run: git fetch --force --tags
|
|
|
|
# Go
|
|
- name: Set up Go ⬇️
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.1'
|
|
|
|
# Download the web folders
|
|
# TODO Uncomment if building web
|
|
- name: Download web folder artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: web
|
|
path: web
|
|
|
|
# Create the binary destination folder
|
|
# ./binaries
|
|
# |--- ...
|
|
- name: Create binary destination folder (UNIX) 🗃️
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
|
|
run: mkdir -p binaries
|
|
- name: Create binary destination folder (Windows) 🗃️
|
|
if: matrix.os == 'windows-latest'
|
|
run: mkdir -p binaries
|
|
shell: bash
|
|
|
|
|
|
#---
|
|
|
|
# ONLY for Windows systray build (seanime-server-systray-windows)
|
|
# For the Windows systray build (built on macOS runner), we need to install the necessary dependencies
|
|
- name: Install C dependencies ⬇️ # macos windows systray build
|
|
if: matrix.id == 'seanime-server-systray-windows'
|
|
run: |
|
|
brew install filosottile/musl-cross/musl-cross
|
|
brew install llvm
|
|
brew install mingw-w64
|
|
|
|
# Build the Windows systray binary
|
|
# ./binaries/seanime-server-systray-windows.exe
|
|
- name: Build Windows Systray 📦️
|
|
if: matrix.id == 'seanime-server-systray-windows'
|
|
env:
|
|
GOARCH: amd64
|
|
GOOS: windows
|
|
CGO_ENABLED: 1
|
|
CC: x86_64-w64-mingw32-gcc
|
|
CXX: x86_64-w64-mingw32-g++
|
|
run: |
|
|
go build -o seanime-server-systray-windows.exe ${{ matrix.go_flags }} .
|
|
|
|
# Build the Windows non-systray binary
|
|
# ./seanime-server-windows.exe
|
|
- name: Build Windows Non-Systray 📦️
|
|
if: matrix.id == 'seanime-server-windows'
|
|
env:
|
|
GOARCH: amd64
|
|
GOOS: windows
|
|
CGO_ENABLED: 0
|
|
run: |
|
|
go build -o seanime-server-windows.exe ${{ matrix.go_flags }} .
|
|
shell: bash
|
|
|
|
# Build the Linux binaries
|
|
# ./seanime-server-linux-amd64
|
|
# ./seanime-server-linux-arm64
|
|
- name: Build Linux 📦️
|
|
if: matrix.id == 'seanime-server-linux'
|
|
run: |
|
|
CGO_ENABLED=0 GOARCH=amd64 go build -o seanime-server-linux-amd64 ${{ matrix.go_flags }} .
|
|
CGO_ENABLED=0 GOARCH=arm64 go build -o seanime-server-linux-arm64 ${{ matrix.go_flags }} .
|
|
|
|
# Build the macOS binaries
|
|
# ./seanime-server-darwin-amd64
|
|
# ./seanime-server-darwin-arm64
|
|
- name: Build macOS 📦️
|
|
if: matrix.id == 'seanime-server-darwin'
|
|
run: |
|
|
CGO_ENABLED=0 GOARCH=amd64 go build -o seanime-server-darwin-amd64 ${{ matrix.go_flags }} .
|
|
CGO_ENABLED=0 GOARCH=arm64 go build -o seanime-server-darwin-arm64 ${{ matrix.go_flags }} .
|
|
|
|
# Tar the binaries
|
|
- name: Tar the binaries (UNIX) 🗃️
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
|
|
# binaries-seanime-server-darwin.tar
|
|
# binaries-seanime-server-linux.tar
|
|
# binaries-seanime-server-systray-windows.tar
|
|
run: |
|
|
tar -cf binaries-${{ matrix.id }}.tar seanime-server-*
|
|
|
|
# Zip the binaries
|
|
- name: Zip the binaries (Windows) 🗃️
|
|
if: matrix.os == 'windows-latest'
|
|
# binaries-seanime-server-windows.zip
|
|
run: |
|
|
7z a "binaries-${{ matrix.id }}.zip" seanime-server-*
|
|
|
|
# Upload the binaries to be used in the next job
|
|
- name: Upload binary folder (UNIX) 📤
|
|
uses: actions/upload-artifact@v4
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
|
|
with:
|
|
# go-seanime-server-linux
|
|
# go-seanime-server-darwin
|
|
# go-seanime-server-systray-windows
|
|
name: go-${{ matrix.id }}
|
|
path: binaries-${{ matrix.id }}.tar
|
|
|
|
- name: Upload binary folder (Windows) 📤
|
|
uses: actions/upload-artifact@v4
|
|
if: matrix.os == 'windows-latest'
|
|
with:
|
|
# go-seanime-server-windows
|
|
name: go-${{ matrix.id }}
|
|
path: binaries-${{ matrix.id }}.zip
|
|
|
|
|
|
build-tauri:
|
|
needs: build-server
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# IDs:
|
|
# - seanime-desktop-darwin-arm
|
|
# - seanime-desktop-darwin-intel
|
|
# - seanime-desktop-linux
|
|
# - seanime-desktop-windows
|
|
include:
|
|
# For Arm-based macs (M1 and above).
|
|
- os: 'macos-latest'
|
|
id: 'seanime-desktop-darwin-arm'
|
|
go_binary_id: 'seanime-server-darwin' # Artifact: go-seanime-server-darwin (contains both arm64 and x86_64)
|
|
args: '--target aarch64-apple-darwin'
|
|
# For Intel-based macs.
|
|
- os: 'macos-latest'
|
|
id: 'seanime-desktop-darwin-intel'
|
|
go_binary_id: 'seanime-server-darwin' # Artifact: go-seanime-server-darwin (contains both arm64 and x86_64)
|
|
args: '--target x86_64-apple-darwin'
|
|
# For Linux
|
|
- os: 'ubuntu-22.04' # for Linux
|
|
id: 'seanime-desktop-linux' # Artifact: go-seanime-server-linux (contains both arm64 and x86_64)
|
|
go_binary_id: 'seanime-server-linux'
|
|
args: ''
|
|
# For Windows
|
|
- os: 'windows-latest' # for Windows
|
|
id: 'seanime-desktop-windows' # Artifact: go-seanime-server-windows (contains x86_64)
|
|
go_binary_id: 'seanime-server-windows'
|
|
args: ''
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies (Ubuntu) ⬇️
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Install Rust stable ⬇️
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
# Those targets are only used on macOS runners so it's in an `if` to slightly speed up windows and linux builds.
|
|
targets: ${{ matrix.id == 'seanime-desktop-darwin-intel' && 'x86_64-apple-darwin' || matrix.id == 'seanime-desktop-darwin-arm' && 'aarch64-apple-darwin' || '' }}
|
|
|
|
- name: Setup node ⬇️
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Tauri CLI ⬇️
|
|
run: |
|
|
cd seanime-desktop
|
|
npm install
|
|
|
|
- name: Rust cache ⬇️
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: './seanime-desktop/src-tauri -> target'
|
|
|
|
|
|
# Download the web folder
|
|
# TODO Uncomment if building web
|
|
- name: Download web folder artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: web-desktop
|
|
path: web-desktop
|
|
|
|
# Download the server binaries depending on matrix.go_binary_id
|
|
- name: Download server binaries 📥
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
# go-seanime-server-windows or
|
|
# go-seanime-server-linux or
|
|
# go-seanime-server-darwin
|
|
name: go-${{ matrix.go_binary_id }}
|
|
path: ./seanime-desktop/src-tauri/binaries
|
|
|
|
- name: Extract server binaries (UNIX) 📂
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04'
|
|
run: tar -xf ./seanime-desktop/src-tauri/binaries/binaries-${{ matrix.go_binary_id }}.tar -C ./seanime-desktop/src-tauri/binaries
|
|
- name: Extract server binaries (Windows) 📂
|
|
if: matrix.os == 'windows-latest'
|
|
run: 7z x ".\seanime-desktop\src-tauri\binaries\binaries-${{ matrix.go_binary_id }}.zip" "-o./seanime-desktop/src-tauri/binaries/"
|
|
|
|
|
|
# ----------------------------------------------------------------- delete
|
|
- name: Print downloaded binaries (UNIX)
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04'
|
|
run: ls -la ./seanime-desktop/src-tauri/binaries
|
|
- name: Print downloaded binaries (Windows)
|
|
if: matrix.os == 'windows-latest'
|
|
run: dir ./seanime-desktop/src-tauri/binaries
|
|
# ----------------------------------------------------------------- delete
|
|
|
|
- name: Determine target triple (UNIX) 🎯
|
|
# id: target_triple
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04'
|
|
run: |
|
|
TARGET_TRIPLE=$(rustc -Vv | grep host | cut -f2 -d' ')
|
|
echo "TARGET_TRIPLE=${TARGET_TRIPLE}" >> $GITHUB_ENV
|
|
|
|
- name: Determine target triple (Windows) 🎯
|
|
# id: target_triple
|
|
if: matrix.os == 'windows-latest'
|
|
run: |
|
|
$TARGET_TRIPLE = rustc -Vv | Select-String "host:" | ForEach-Object {$_.Line.split(" ")[1]}
|
|
echo "TARGET_TRIPLE=$TARGET_TRIPLE" >> $env:GITHUB_ENV
|
|
shell: pwsh
|
|
|
|
# seanime-server-windows.exe -> seanime-x86_64-pc-windows-msvc.exe
|
|
- name: Rename sidecar binary (Windows) 📝
|
|
if: matrix.id == 'seanime-desktop-windows'
|
|
run: |
|
|
powershell -Command "Rename-Item -Path ./seanime-desktop/src-tauri/binaries/seanime-server-windows.exe -NewName seanime-${{ env.TARGET_TRIPLE }}.exe"
|
|
|
|
# seanime-server-linux-amd64 -> seanime-unknown-linux-musl
|
|
- name: Rename sidecar binaries (Linux) 📝
|
|
if: matrix.id == 'seanime-desktop-linux'
|
|
run: |
|
|
mv ./seanime-desktop/src-tauri/binaries/seanime-server-linux-amd64 ./seanime-desktop/src-tauri/binaries/seanime-${{ env.TARGET_TRIPLE }}
|
|
|
|
# seanime-server-darwin-amd64 -> seanime-x86_64-apple-darwin
|
|
- name: Rename sidecar binaries (MacOS Intel) 📝
|
|
if: matrix.id == 'seanime-desktop-darwin-intel'
|
|
# Here we hardcode the target triple because the macOS runner is ARM based
|
|
run: |
|
|
mv ./seanime-desktop/src-tauri/binaries/seanime-server-darwin-amd64 ./seanime-desktop/src-tauri/binaries/seanime-x86_64-apple-darwin
|
|
|
|
# seanime-server-darwin-arm64 -> seanime-aarch64-apple-darwin
|
|
- name: Rename sidecar binaries (MacOS Arm) 📝
|
|
if: matrix.id == 'seanime-desktop-darwin-arm'
|
|
run: |
|
|
mv ./seanime-desktop/src-tauri/binaries/seanime-server-darwin-arm64 ./seanime-desktop/src-tauri/binaries/seanime-${{ env.TARGET_TRIPLE }}
|
|
|
|
# ----------------------------------------------------------------- delete
|
|
- name: Print downloaded binaries
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04'
|
|
run: ls -la ./seanime-desktop/src-tauri/binaries
|
|
- name: Print downloaded binaries
|
|
if: matrix.os == 'windows-latest'
|
|
run: dir ./seanime-desktop/src-tauri/binaries
|
|
# ----------------------------------------------------------------- delete
|
|
|
|
# Build Tauri
|
|
- name: Run Tauri action 🚀
|
|
id: tauri-action
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
|
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
# APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
|
# APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
with:
|
|
projectPath: './seanime-desktop'
|
|
args: ${{ matrix.args }}
|
|
updaterJsonPreferNsis: true
|
|
|
|
- name: Rename Tauri artifacts (UNIX) 📝
|
|
# ./
|
|
# |- seanime-desktop-darwin-arm.app.tar.gz
|
|
# |- seanime-desktop-darwin-arm.app.tar.gz.sig <- Signature
|
|
# |- seanime-desktop-darwin-intel.app.tar.gz
|
|
# |- seanime-desktop-darwin-intel.app.tar.gz.sig <- Signature
|
|
# |- seanime-desktop-linux.AppImage <- UNCOMPRESSED
|
|
# |- seanime-desktop-linux.AppImage.sig <- Signature UNCOMPRESSED
|
|
# |- seanime-desktop-windows-setup.exe <- UNCOMPRESSED
|
|
# |- seanime-desktop-windows-setup.exe.sig <- Signature UNCOMPRESSED
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04'
|
|
# We hardcode the macOS target triple because the macOS runner is ARM based and builds both arm64 and x86_64
|
|
run: |
|
|
if [ -f ./seanime-desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Seanime\ Desktop.app.tar.gz ]; then
|
|
mv ./seanime-desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Seanime\ Desktop.app.tar.gz ./seanime-desktop-darwin-arm.app.tar.gz
|
|
mv ./seanime-desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/Seanime\ Desktop.app.tar.gz.sig ./seanime-desktop-darwin-arm.app.tar.gz.sig
|
|
|
|
elif [ -f ./seanime-desktop/src-tauri/target/x86_64-apple-darwin/release/bundle/macos/Seanime\ Desktop.app.tar.gz ]; then
|
|
mv ./seanime-desktop/src-tauri/target/x86_64-apple-darwin/release/bundle/macos/Seanime\ Desktop.app.tar.gz ./seanime-desktop-darwin-intel.app.tar.gz
|
|
mv ./seanime-desktop/src-tauri/target/x86_64-apple-darwin/release/bundle/macos/Seanime\ Desktop.app.tar.gz.sig ./seanime-desktop-darwin-intel.app.tar.gz.sig
|
|
|
|
elif [ -f ./seanime-desktop/src-tauri/target/release/bundle/appimage/Seanime\ Desktop_${{ steps.tauri-action.outputs.appVersion }}_amd64.AppImage ]; then
|
|
mv ./seanime-desktop/src-tauri/target/release/bundle/appimage/Seanime\ Desktop_${{ steps.tauri-action.outputs.appVersion }}_amd64.AppImage ./seanime-desktop-linux.AppImage
|
|
mv ./seanime-desktop/src-tauri/target/release/bundle/appimage/Seanime\ Desktop_${{ steps.tauri-action.outputs.appVersion }}_amd64.AppImage.sig ./seanime-desktop-linux.AppImage.sig
|
|
fi
|
|
|
|
- name: Rename Tauri artifacts (Windows) 📝
|
|
if: matrix.os == 'windows-latest'
|
|
run: |
|
|
powershell -Command "Move-Item -Path './seanime-desktop/src-tauri/target/release/bundle/nsis/Seanime Desktop_${{ steps.tauri-action.outputs.appVersion }}_x64-setup.exe' -Destination './seanime-desktop-windows-setup.exe'"
|
|
powershell -Command "Move-Item -Path './seanime-desktop/src-tauri/target/release/bundle/nsis/Seanime Desktop_${{ steps.tauri-action.outputs.appVersion }}_x64-setup.exe.sig' -Destination './seanime-desktop-windows-setup.exe.sig'"
|
|
|
|
- name: Tar the Tauri artifacts (Linux) 🗃️
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
# Note: The macOS artifacts are already packaged, so we don't need to compress them
|
|
# Compress the Linux AppImage, not the signature
|
|
run: |
|
|
if [ -f ./seanime-desktop-linux.AppImage ]; then
|
|
tar -czf seanime-desktop-linux.AppImage.tar.gz seanime-desktop-linux.AppImage
|
|
fi
|
|
- name: Zip the Tauri artifacts (Windows) 🗃️
|
|
if: matrix.os == 'windows-latest'
|
|
# Compress the Windows setup, not the signature
|
|
run: |
|
|
7z a seanime-desktop-windows-setup.exe.zip seanime-desktop-windows-setup.exe
|
|
|
|
# ----------------------------------------------------------------- delete
|
|
- name: Print all
|
|
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04'
|
|
run: ls -la .
|
|
- name: Print downloaded binaries
|
|
if: matrix.os == 'windows-latest'
|
|
run: dir .
|
|
# ----------------------------------------------------------------- delete
|
|
|
|
# Upload the Tauri artifacts to be used in the next job
|
|
- name: Upload tauri artifacts 📤
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
# Artifact IDs:
|
|
# tauri-seanime-server-darwin-arm
|
|
# tauri-seanime-server-darwin-intel
|
|
# tauri-seanime-server-linux
|
|
# tauri-seanime-server-windows
|
|
name: tauri-${{ matrix.id }}
|
|
path: |
|
|
./seanime-desktop-darwin-arm.app.tar.gz
|
|
./seanime-desktop-darwin-arm.app.tar.gz.sig
|
|
./seanime-desktop-darwin-intel.app.tar.gz
|
|
./seanime-desktop-darwin-intel.app.tar.gz.sig
|
|
./seanime-desktop-linux.AppImage
|
|
./seanime-desktop-linux.AppImage.tar.gz
|
|
./seanime-desktop-linux.AppImage.sig
|
|
./seanime-desktop-windows-setup.exe
|
|
./seanime-desktop-windows-setup.exe.zip
|
|
./seanime-desktop-windows-setup.exe.sig
|
|
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [ build-server, build-tauri ]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Download tauri artifacts 📥
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: tauri-*
|
|
path: ./artifacts
|
|
merge-multiple: true
|
|
|
|
- name: Determine version from tag name 🔎
|
|
run: |
|
|
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
|
VERSION=${GITHUB_REF/refs\/tags\/v/}
|
|
echo "Version extracted from tag: $VERSION"
|
|
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF/refs\/tags\//}
|
|
echo "Version extracted from tag: $VERSION"
|
|
else
|
|
echo "Warning: No tag associated with this run. Defaulting to version 0.1.0."
|
|
VERSION="0.1.0"
|
|
fi
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Print version
|
|
run: echo "Version is ${{ env.VERSION }}"
|
|
|
|
- name: Download server binaries 📥
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: go-*
|
|
path: ./artifacts
|
|
# ./artifacts
|
|
# |- binaries-seanime-server-darwin.tar (contains 2)
|
|
# |- binaries-seanime-server-linux.tar (contains 2)
|
|
# |- binaries-seanime-server-systray-windows.tar (contains 1)
|
|
merge-multiple: true
|
|
|
|
- name: Print all artifacts
|
|
run: ls -la ./artifacts
|
|
|
|
- name: Extract - Rename - Archive server binaries 📂
|
|
# ./artifacts
|
|
# |- ...
|
|
# \/ /binaries-seanime-server-darwin.tar
|
|
# |- seanime-server-darwin-amd64 -> ../seanime -> ../seanime-${{ env.VERSION }}_MacOS_arm64.tar.gz
|
|
# |- seanime-server-darwin-arm64 -> ../seanime -> ../seanime-${{ env.VERSION }}_MacOS_x86_64.tar.gz
|
|
# \/ /binaries-seanime-server-darwin.tar
|
|
# |- seanime-server-linux-amd64 -> ../seanime -> ../seanime-${{ env.VERSION }}_Linux_x86_64.tar.gz
|
|
# |- seanime-server-linux-arm64 -> ../seanime -> ../seanime-${{ env.VERSION }}_Linux_arm64.tar.gz
|
|
# \/ /binaries-seanime-server-systray-windows.tar
|
|
# |- seanime-server-systray-windows.exe -> ../seanime.exe -> ../seanime-${{ env.VERSION }}_Windows_x86_64.zip
|
|
run: |
|
|
if [ -f ./artifacts/binaries-seanime-server-darwin.tar ]; then
|
|
# Extract binaries
|
|
tar -xf ./artifacts/binaries-seanime-server-darwin.tar -C ./artifacts
|
|
|
|
# Rename & compress binaries
|
|
mv ./artifacts/seanime-server-darwin-amd64 ./seanime
|
|
tar czf ./seanime-${{ env.VERSION }}_MacOS_x86_64.tar.gz ./seanime
|
|
rm -rf ./seanime
|
|
|
|
|
|
mv ./artifacts/seanime-server-darwin-arm64 ./seanime
|
|
tar czf ./seanime-${{ env.VERSION }}_MacOS_arm64.tar.gz ./seanime
|
|
rm -rf ./seanime
|
|
fi
|
|
|
|
if [ -f ./artifacts/binaries-seanime-server-linux.tar ]; then
|
|
# Extract binaries
|
|
tar -xf ./artifacts/binaries-seanime-server-linux.tar -C ./artifacts
|
|
|
|
# Rename & compress binaries
|
|
mv ./artifacts/seanime-server-linux-amd64 ./seanime
|
|
tar czf ./seanime-${{ env.VERSION }}_Linux_x86_64.tar.gz ./seanime
|
|
rm -rf ./seanime
|
|
|
|
|
|
mv ./artifacts/seanime-server-linux-arm64 ./seanime
|
|
tar czf ./seanime-${{ env.VERSION }}_Linux_arm64.tar.gz ./seanime
|
|
rm -rf ./seanime
|
|
fi
|
|
|
|
if [ -f ./artifacts/binaries-seanime-server-systray-windows.tar ]; then
|
|
# Extract binaries
|
|
tar -xf ./artifacts/binaries-seanime-server-systray-windows.tar -C ./artifacts
|
|
|
|
# Rename & compress binaries
|
|
mv ./artifacts/seanime-server-systray-windows.exe ./seanime.exe
|
|
7z a ./seanime-${{ env.VERSION }}_Windows_x86_64.zip ./seanime.exe
|
|
rm -rf ./seanime.exe
|
|
fi
|
|
shell: bash
|
|
|
|
- name: Print all artifacts
|
|
run: ls -la ./artifacts
|
|
|
|
- name: Move & Rename Tauri assets 📝🗃️
|
|
# Move Tauri assets to the root directory and rename them
|
|
# ./artifacts
|
|
# |- seanime-desktop-darwin-arm.app.tar.gz -> ../seanime-desktop-${{ env.VERSION }}_MacOS_arm64.app.tar.gz
|
|
# |- seanime-desktop-darwin-arm.app.tar.gz.sig -> ../seanime-desktop-${{ env.VERSION }}_MacOS_arm64.app.tar.gz.sig
|
|
# |- seanime-desktop-darwin-intel.app.tar.gz -> ../seanime-desktop-${{ env.VERSION }}_MacOS_x86_64.app.tar.gz
|
|
# |- seanime-desktop-darwin-intel.app.tar.gz.sig -> ../seanime-desktop-${{ env.VERSION }}_MacOS_x86_64.app.tar.gz.sig
|
|
# |- seanime-desktop-linux.AppImage -> ../seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage
|
|
# |- seanime-desktop-linux.AppImage.tar.gz -> ../seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage.tar.gz
|
|
# |- seanime-desktop-linux.AppImage.sig -> ../seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage.sig
|
|
# |- seanime-desktop-windows-setup.exe -> ../seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe
|
|
# |- seanime-desktop-windows-setup.exe.zip -> ../seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe.zip
|
|
# |- seanime-desktop-windows-setup.exe.sig -> ../seanime-desktop-${{ env.VERSION }}_Windows_x86_64.sig
|
|
run: |
|
|
if [ -f ./artifacts/seanime-desktop-darwin-arm.app.tar.gz ]; then
|
|
mv ./artifacts/seanime-desktop-darwin-arm.app.tar.gz ./seanime-desktop-${{ env.VERSION }}_MacOS_arm64.app.tar.gz
|
|
mv ./artifacts/seanime-desktop-darwin-arm.app.tar.gz.sig ./seanime-desktop-${{ env.VERSION }}_MacOS_arm64.app.tar.gz.sig
|
|
fi
|
|
if [ -f ./artifacts/seanime-desktop-darwin-intel.app.tar.gz ]; then
|
|
mv ./artifacts/seanime-desktop-darwin-intel.app.tar.gz ./seanime-desktop-${{ env.VERSION }}_MacOS_x86_64.app.tar.gz
|
|
mv ./artifacts/seanime-desktop-darwin-intel.app.tar.gz.sig ./seanime-desktop-${{ env.VERSION }}_MacOS_x86_64.app.tar.gz.sig
|
|
fi
|
|
if [ -f ./artifacts/seanime-desktop-linux.AppImage.tar.gz ]; then
|
|
mv ./artifacts/seanime-desktop-linux.AppImage ./seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage
|
|
mv ./artifacts/seanime-desktop-linux.AppImage.tar.gz ./seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage.tar.gz
|
|
mv ./artifacts/seanime-desktop-linux.AppImage.sig ./seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage.sig
|
|
fi
|
|
if [ -f ./artifacts/seanime-desktop-windows-setup.exe.zip ]; then
|
|
mv ./artifacts/seanime-desktop-windows-setup.exe ./seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe
|
|
mv ./artifacts/seanime-desktop-windows-setup.exe.zip ./seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe.zip
|
|
mv ./artifacts/seanime-desktop-windows-setup.exe.sig ./seanime-desktop-${{ env.VERSION }}_Windows_x86_64.sig
|
|
fi
|
|
|
|
- name: Print all
|
|
run: ls -la .
|
|
|
|
# Go
|
|
- name: Set up Go ⬇️
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.1'
|
|
|
|
# Build the Go script
|
|
- name: Build Go scripts 🛠️
|
|
run: |
|
|
go build -o generate_updater_latest ./.github/scripts/generate_updater_latest.go
|
|
go build -o generate_release_notes ./.github/scripts/generate_release_notes.go
|
|
|
|
# Run the Go scripts
|
|
- name: Generate latest.json 📦️
|
|
env:
|
|
APP_VERSION: ${{ env.VERSION }}
|
|
run: ./generate_updater_latest
|
|
- name: Generate release notes 📦️
|
|
env:
|
|
APP_VERSION: ${{ env.VERSION }}
|
|
run: ./generate_release_notes
|
|
|
|
- name: Read release notes 🔍
|
|
id: read_release_notes
|
|
run: |
|
|
BODY=$(cat whats-new.md)
|
|
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
|
|
echo "$BODY" >> $GITHUB_ENV
|
|
echo "EOF" >> $GITHUB_ENV
|
|
|
|
- name: Create release draft 🚀🚀🚀
|
|
id: create_release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
fail_on_unmatched_files: false
|
|
files: |
|
|
latest.json
|
|
seanime-desktop-${{ env.VERSION }}_MacOS_arm64.app.tar.gz
|
|
seanime-desktop-${{ env.VERSION }}_MacOS_arm64.app.tar.gz.sig
|
|
seanime-desktop-${{ env.VERSION }}_MacOS_x86_64.app.tar.gz
|
|
seanime-desktop-${{ env.VERSION }}_MacOS_x86_64.app.tar.gz.sig
|
|
seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage
|
|
seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage.tar.gz
|
|
seanime-desktop-${{ env.VERSION }}_Linux_x86_64.AppImage.sig
|
|
seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe
|
|
seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe.zip
|
|
seanime-desktop-${{ env.VERSION }}_Windows_x86_64.exe.sig
|
|
seanime-${{ env.VERSION }}_MacOS_x86_64.tar.gz
|
|
seanime-${{ env.VERSION }}_MacOS_arm64.tar.gz
|
|
seanime-${{ env.VERSION }}_Linux_x86_64.tar.gz
|
|
seanime-${{ env.VERSION }}_Linux_arm64.tar.gz
|
|
seanime-${{ env.VERSION }}_Windows_x86_64.zip
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag_name: v${{ env.VERSION }}
|
|
release_name: v${{ env.VERSION }}
|
|
draft: true
|
|
prerelease: false
|
|
body: |
|
|
## What's new?
|
|
|
|
${{ env.RELEASE_BODY }}
|
|
|
|
---
|
|
[Open an issue](https://github.com/5rahim/seanime/issues/new/choose)
|