ci: separate build/publish (don't run build on all platforms)
ci: don't try to build AppX in CI/CD context
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
build:
|
||||
name: Build App
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -38,13 +29,5 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Build or Publish
|
||||
run: |
|
||||
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
|
||||
pnpm run publish
|
||||
else
|
||||
pnpm run make
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build
|
||||
run: pnpm run package
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Publish App
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout assets
|
||||
run: git -c submodule."assets".update=checkout submodule update --init assets
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Publish
|
||||
run: pnpm run publish
|
||||
env:
|
||||
PLATFORM: ${{ matrix.os }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
+35
-21
@@ -21,24 +21,10 @@ const STRINGS = {
|
||||
|
||||
const ASSET_DIR = "assets/desktop";
|
||||
|
||||
const config: ForgeConfig = {
|
||||
packagerConfig: {
|
||||
asar: true,
|
||||
name: STRINGS.name,
|
||||
executableName: STRINGS.execName,
|
||||
icon: `${ASSET_DIR}/icon`,
|
||||
// extraResource: [
|
||||
// // include all the asset files
|
||||
// ...globSync(ASSET_DIR + "/**/*"),
|
||||
// ],
|
||||
},
|
||||
rebuildConfig: {},
|
||||
makers: [
|
||||
new MakerAppX({
|
||||
certPass: "",
|
||||
packageExecutable: `app\\${STRINGS.execName}.exe`,
|
||||
publisher: "CN=B040CC7E-0016-4AF5-957F-F8977A6CFA3B",
|
||||
}),
|
||||
/**
|
||||
* Build targets for the desktop app
|
||||
*/
|
||||
const makers: ForgeConfig["makers"] = [
|
||||
new MakerSquirrel({
|
||||
name: STRINGS.name,
|
||||
authors: STRINGS.author,
|
||||
@@ -52,7 +38,20 @@ const config: ForgeConfig = {
|
||||
copyright: "Copyright (C) 2025 Revolt Platforms LTD",
|
||||
}),
|
||||
new MakerZIP({}),
|
||||
...[
|
||||
];
|
||||
|
||||
// skip these makers in CI/CD
|
||||
if (!process.env.PLATFORM) {
|
||||
makers.push(
|
||||
// must be manually built (freezes CI process)
|
||||
// not much use in being published anyhow
|
||||
new MakerAppX({
|
||||
certPass: "",
|
||||
packageExecutable: `app\\${STRINGS.execName}.exe`,
|
||||
publisher: "CN=B040CC7E-0016-4AF5-957F-F8977A6CFA3B",
|
||||
}),
|
||||
// flatpak publishing should occur through flathub repos.
|
||||
// this is just for testing purposes
|
||||
new MakerFlatpak({
|
||||
options: {
|
||||
id: "chat.stoat.stoat-desktop",
|
||||
@@ -111,7 +110,7 @@ const config: ForgeConfig = {
|
||||
"files"
|
||||
> */
|
||||
}),
|
||||
].slice(0, 0), // disable Flatpak build
|
||||
// testing purposes
|
||||
new MakerDeb({
|
||||
options: {
|
||||
productName: STRINGS.name,
|
||||
@@ -120,7 +119,22 @@ const config: ForgeConfig = {
|
||||
icon: `${ASSET_DIR}/icon.png`,
|
||||
},
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
const config: ForgeConfig = {
|
||||
packagerConfig: {
|
||||
asar: true,
|
||||
name: STRINGS.name,
|
||||
executableName: STRINGS.execName,
|
||||
icon: `${ASSET_DIR}/icon`,
|
||||
// extraResource: [
|
||||
// // include all the asset files
|
||||
// ...globSync(ASSET_DIR + "/**/*"),
|
||||
// ],
|
||||
},
|
||||
rebuildConfig: {},
|
||||
makers,
|
||||
plugins: [
|
||||
new VitePlugin({
|
||||
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "stoat-desktop",
|
||||
"productName": "stoat-desktop",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"main": ".vite/build/main.js",
|
||||
"repository": "stoatchat/desktop",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user