Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Jul 8, 2024
1 parent 15f95f7 commit 0466634
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 36 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Publish new release

on:
push:
tags:
- "*"
on: push

jobs:
release:
strategy:
matrix:
os: [macos-13, macos-14, windows-2022, ubuntu-22.04]
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
name: Publish new release
steps:
Expand Down Expand Up @@ -37,18 +34,6 @@ jobs:
env:
NODE_ENV: development

- name: Run typecheck
run: pnpm typecheck

- name: Run linter
run: pnpm lint

- name: Run prettier
run: pnpm prettier:check

- name: Run tests
run: pnpm test

- name: Build app
run: pnpm build
env:
Expand Down
56 changes: 37 additions & 19 deletions electron-builder.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const { execSync } = require("child_process");
const { existsSync } = require("fs");
const { join } = require("path");

/**
* @type {import('electron-builder').Configuration}
* @see https://www.electron.build/configuration/configuration
Expand All @@ -10,31 +14,45 @@ module.exports = {
output: "release",
buildResources: "build",
},
afterPack: (context) => {
const { appOutDir, packager, electronPlatformName } = context;

// Only proceed for macOS builds
if (electronPlatformName !== "darwin") {
console.log("Skipping ad-hoc signing for non-macOS platform");
return;
}

const appName = packager.appInfo.productFilename;
const appPath = join(appOutDir, `${appName}.app`);

if (!existsSync(appPath)) {
console.error(`App not found at path: ${appPath}`);
return;
}

console.log("Performing ad-hoc signing...");

try {
// Remove existing signature if any
execSync(`codesign --remove-signature "${appPath}"`, { stdio: "inherit" });

// Perform ad-hoc signing
execSync(`codesign --force --deep -s - "${appPath}"`, { stdio: "inherit" });

console.log("Ad-hoc signing completed successfully");
} catch (error) {
console.error("Error during ad-hoc signing:", error.message);
throw error;
}
},
files: ["dist-main/index.js", "dist-preload/index.js", "dist-renderer/**/*", "assets/**/*"],
extraMetadata: {
version: process.env.VITE_APP_VERSION,
},
mac: {
category: "public.app-category.utilities",
icon: "assets/Build/app-icon-dark.png",
target: [{ target: "dmg" }, { target: "zip" }],
},
win: {
icon: "assets/Build/app-icon-dark-transparent.png",
target: [{ target: "msi" }, { target: "nsis" }, { target: "zip" }, { target: "appx" }],
},
appx: {
applicationId: "OliverSchwendener.Ueli",
backgroundColor: "#1F1F1F",
displayName: "Ueli",
identityName: "1915OliverSchwendener.Ueli",
publisher: "CN=AD6BF16D-50E3-4FD4-B769-78A606AFF75E",
publisherDisplayName: "Oliver Schwendener",
languages: ["en-US", "de-CH"],
},
linux: {
icon: "assets/Build/app-icon-dark.png",
category: "Utility",
target: [{ target: "AppImage" }, { target: "deb" }, { target: "zip" }],
target: [{ target: "zip" }],
},
};

0 comments on commit 0466634

Please sign in to comment.