release workflow

This commit is contained in:
5rahim
2025-10-13 21:13:15 +02:00
parent c593ad9070
commit 3dbbe3ba5f
8 changed files with 119 additions and 98 deletions

View File

@@ -2,6 +2,9 @@ name: Build Electron App
on:
workflow_call:
secrets:
SUBMODULE_PAT:
required: true
outputs:
appVersion:
description: "The version of the app"
@@ -18,36 +21,34 @@ jobs:
# - seanime-denshi-linux
# - seanime-denshi-windows
include:
# For Mac Universal
# For Mac
- os: 'macos-latest'
id: 'seanime-denshi-darwin-arm64'
go_binary_id: 'seanime-server-darwin' # Artifact: go-seanime-server-darwin (contains both arm64 and x86_64)
electron_args: '--mac --arm64'
# For Intel-based macs
- os: 'macos-latest'
id: 'seanime-denshi-darwin-x64'
go_binary_id: 'seanime-server-darwin' # Artifact: go-seanime-server-darwin (contains both arm64 and x86_64)
electron_args: '--mac --x64'
# For Linux
- os: 'ubuntu-latest'
id: 'seanime-denshi-linux-x64'
go_binary_id: 'seanime-server-linux' # Artifact: go-seanime-server-linux (contains x86_64)
electron_args: '--linux'
electron_args: '--linux --x64'
# For Windows
- os: 'windows-latest'
id: 'seanime-denshi-windows-x64'
go_binary_id: 'seanime-server-windows' # Artifact: go-seanime-server-windows (contains x86_64)
electron_args: '--win'
electron_args: '--win --x64'
runs-on: ${{ matrix.os }}
outputs:
app_version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout code 📂
- name: Checkout code and submodules 📂
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
lfs: true
token: ${{ secrets.SUBMODULE_PAT }}
- name: Setup Node.js 📦
uses: actions/setup-node@v4
@@ -68,12 +69,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libnss3-dev libxss-dev libasound2-dev
# Download the web folders
- name: Download web folder artifact 📥
uses: actions/download-artifact@v4
with:
name: web-denshi
path: web-denshi
# # Download the web folders
# # TODO Uncomment if building web
# - name: Download web folder artifact 📥
# uses: actions/download-artifact@v4
# with:
# name: web-denshi
# path: web-denshi
# Move web-denshi folder into seanime-denshi
- name: Move web-denshi folder 🚚
@@ -96,14 +98,14 @@ jobs:
path: ./seanime-denshi/binaries
# Extract server binaries
- name: Extract server binaries (macOS x64) 📂
if: matrix.os == 'macos-latest' && matrix.id == 'seanime-denshi-darwin-x64'
# Extracts seanime-server-darwin-arm64 and seanime-server-darwin-amd64
# Only keep seanime-server-darwin-amd64
run: |
tar -xf ./seanime-denshi/binaries/binaries-${{ matrix.go_binary_id }}.tar -C ./seanime-denshi/binaries
# Remove the other binary
rm -rf ./seanime-denshi/binaries/seanime-server-darwin-arm64
# - name: Extract server binaries (macOS x64) 📂
# if: matrix.os == 'macos-latest' && matrix.id == 'seanime-denshi-darwin-x64'
# # Extracts seanime-server-darwin-arm64 and seanime-server-darwin-amd64
# # Only keep seanime-server-darwin-amd64
# run: |
# tar -xf ./seanime-denshi/binaries/binaries-${{ matrix.go_binary_id }}.tar -C ./seanime-denshi/binaries
# # Remove the other binary
# rm -rf ./seanime-denshi/binaries/seanime-server-darwin-arm64
- name: Extract server binaries (macOS arm64) 📂
if: matrix.os == 'macos-latest' && matrix.id == 'seanime-denshi-darwin-arm64'
@@ -147,5 +149,5 @@ jobs:
with:
name: electron-${{ matrix.id }}
path: |
./seanime-denshi-*
./seanime-denshi/dist/seanime-denshi-*
./seanime-denshi/dist/*.yml

View File

@@ -11,49 +11,49 @@ permissions:
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
npm run build:denshi
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 (Electron)
uses: actions/upload-artifact@v4
with:
name: web-desktop
path: seanime-web/out-desktop # output dir of build:desktop
- name: Upload web folder (Electron)
uses: actions/upload-artifact@v4
with:
name: web-denshi
path: seanime-web/out-denshi # output dir of build:denshi
# 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
# npm run build:denshi
# 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 (Electron)
# uses: actions/upload-artifact@v4
# with:
# name: web-desktop
# path: seanime-web/out-desktop # output dir of build:desktop
# - name: Upload web folder (Electron)
# uses: actions/upload-artifact@v4
# with:
# name: web-denshi
# path: seanime-web/out-denshi # output dir of build:denshi
build-server:
needs: build-webapp # TODO Uncomment if building web
# needs: build-webapp # TODO Uncomment if building web
runs-on: ${{ matrix.os }}
strategy:
@@ -97,13 +97,24 @@ jobs:
with:
go-version: '1.25.1'
# Download the web folders
# TODO Uncomment if building web
- name: Download web folder artifact
uses: actions/download-artifact@v4
# Cache Go modules
- name: Cache Go modules 💾
uses: actions/cache@v4
with:
name: web
path: web
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# # 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
@@ -208,7 +219,9 @@ jobs:
build-electron:
needs: build-server
uses: electron-build.yml
uses: ./.github/workflows/electron-build.yml
secrets:
SUBMODULE_PAT: ${{ secrets.SUBMODULE_PAT }}
release:
runs-on: ubuntu-latest
@@ -225,6 +238,7 @@ jobs:
with:
pattern: electron-*
path: ./artifacts
# ./artifacts
merge-multiple: true
- name: Determine version from tag name 🔎
@@ -317,17 +331,17 @@ jobs:
- name: Move & Rename Electron assets 📝🗃️
# Move Electron assets to the root directory and rename them
run: |
if [ -f ./artifacts/seanime-denshi-darwin-arm64.dmg ]; then
mv ./artifacts/seanime-denshi-darwin-arm64.dmg ./seanime-denshi-${{ env.VERSION }}_MacOS_arm64.dmg
if [ -f ./artifacts/seanime-denshi-${{ env.VERSION }}_MacOS_arm64.dmg ]; then
mv ./artifacts/seanime-denshi-${{ env.VERSION }}_MacOS_arm64.dmg ./seanime-denshi-${{ env.VERSION }}_MacOS_arm64.dmg
fi
if [ -f ./artifacts/seanime-denshi-darwin-x64.dmg ]; then
mv ./artifacts/seanime-denshi-darwin-x64.dmg ./seanime-denshi-${{ env.VERSION }}_MacOS_x64.dmg
if [ -f ./artifacts/seanime-denshi-${{ env.VERSION }}_MacOS_x64.dmg ]; then
mv ./artifacts/seanime-denshi-${{ env.VERSION }}_MacOS_x64.dmg ./seanime-denshi-${{ env.VERSION }}_MacOS_x64.dmg
fi
if [ -f ./artifacts/seanime-denshi-linux-x64.AppImage ]; then
mv ./artifacts/seanime-denshi-linux-x64.AppImage ./seanime-denshi-${{ env.VERSION }}_Linux_x64.AppImage
if [ -f ./artifacts/seanime-denshi-${{ env.VERSION }}_Linux_x86_64.AppImage ]; then
mv ./artifacts/seanime-denshi-${{ env.VERSION }}_Linux_x86_64.AppImage ./seanime-denshi-${{ env.VERSION }}_Linux_x86_64.AppImage
fi
if [ -f ./artifacts/seanime-denshi-windows-x64.exe ]; then
mv ./artifacts/seanime-denshi-windows-x64.exe ./seanime-denshi-${{ env.VERSION }}_Windows_x64.exe
if [ -f ./artifacts/seanime-denshi-${{ env.VERSION }}_Windows_x64.exe ]; then
mv ./artifacts/seanime-denshi-${{ env.VERSION }}_Windows_x64.exe ./seanime-denshi-${{ env.VERSION }}_Windows_x64.exe
fi
# Copy electron-builder YML files if they exist
@@ -378,8 +392,7 @@ jobs:
latest-mac-arm64.yml
# Electron Desktop builds
seanime-denshi-${{ env.VERSION }}_MacOS_arm64.dmg
seanime-denshi-${{ env.VERSION }}_MacOS_x64.dmg
seanime-denshi-${{ env.VERSION }}_Linux_x64.AppImage
seanime-denshi-${{ env.VERSION }}_Linux_x86_64.AppImage
seanime-denshi-${{ env.VERSION }}_Windows_x64.exe
# Server builds
seanime-${{ env.VERSION }}_MacOS_x86_64.tar.gz

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "electron"]
path = electron
url = https://github.com/5rahim/seanime-electron.git

1
electron Submodule

Submodule electron added at 4bf0e90763

View File

@@ -6,8 +6,8 @@ import (
)
const (
Version = "3.0.0-alpha.0"
VersionName = "iOSOS"
Version = "2.15.0"
VersionName = "Crimson"
GcTime = time.Minute * 30
ConfigFileName = "config.toml"
MalClientId = "51cb4294feb400f3ddc66a30f9b9a00f"

View File

@@ -22,7 +22,7 @@ func TestUpdater_getReleaseName(t *testing.T) {
func TestUpdater_FetchLatestRelease(t *testing.T) {
fallbackGithubUrl = "https://seanimedud.app/api/releases" // simulate dead endpoint
//githubUrl = "https://api.github.com/repos/zbonfo/seanime-desktop/releases/latest"
//githubUrl = "https://api.github.com/repos/5rahim/seanime-desktop/releases/latest"
updater := New(constants.Version, util.NewLogger(), events.NewMockWSEventManager(util.NewLogger()))
release, err := updater.fetchLatestRelease()

View File

@@ -1,14 +1,14 @@
{
"name": "seanime-denshi",
"version": "2.10.0",
"version": "2.15.0",
"description": "Electron-based Desktop client for Seanime",
"main": "src/main.js",
"scripts": {
"dev": "NODE_ENV=development electron .",
"build": "electron-builder build",
"build:mac": "electron-builder build --mac",
"build:win": "electron-builder build --win",
"build:linux": "electron-builder build --linux"
"build:win": "electron-builder build --win --x64",
"build:linux": "electron-builder build --linux --x64"
},
"dependencies": {
"electron-log": "^5.0.0",
@@ -19,11 +19,11 @@
},
"devDependencies": {
"cross-env": "^7.0.3",
"electron": "^36.1.2",
"electron": "^36.2.1",
"electron-builder": "^24.13.3"
},
"build": {
"electronDist": "/Users/rahim/IdeaProjects/electron-v36.2.1/archives/",
"electronDist": "../electron",
"appId": "app.seanime.denshi",
"productName": "Seanime Denshi",
"asar": true,
@@ -47,7 +47,6 @@
{
"target": "dmg",
"arch": [
"x64",
"arm64"
]
}
@@ -55,6 +54,7 @@
"darkModeSupport": true,
"notarize": false,
"hardenedRuntime": true,
"identity": "-",
"gatekeeperAssess": false,
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
@@ -69,15 +69,15 @@
]
}
],
"artifactName": "seanime-denshi-${version}_Windows_${arch}.${ext}"
"artifactName": "seanime-denshi-${version}_Windows_${arch}.${ext}",
"verifyUpdateCodeSignature": false
},
"linux": {
"target": [
{
"target": "AppImage",
"arch": [
"x64",
"arm64"
"x64"
]
}
],
@@ -89,8 +89,10 @@
"allowToChangeInstallationDirectory": true,
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"deleteAppDataOnUninstall": true,
"shortcutName": "Seanime Denshi",
"artifactName": "seanime-denshi-${version}_Windows_${arch}.${ext}"
"artifactName": "seanime-denshi-${version}_Windows_${arch}.${ext}",
"perMachine": true
},
"directories": {
"buildResources": "assets",

View File

@@ -5,11 +5,11 @@ build-web-only:
build-web:
rm -rf ../web
rm -rf ../web-desktop
rm -rf ../web-denshi
npm run build
cp -r out ../web
npm run build:desktop
cp -r out-desktop ../web-desktop
npm run build:denshi
cp -r out-denshi ../web-denshi
build-denshi:
rm -rf ../web-denshi