Add GitHub release workflow for publishing the app

This commit is contained in:
Ylber Gashi
2024-10-30 23:04:17 +01:00
parent 5c303a2fe3
commit 8bbd4fffcc
2 changed files with 70 additions and 0 deletions

57
.github/workflows/publish-app.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Publish App
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 22
# Set VERSION for Unix-like systems
- name: Set VERSION (Unix)
if: matrix.os != 'windows-latest'
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
# Set VERSION for Windows
- name: Set VERSION (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$version = $env:GITHUB_REF -replace '^refs/tags/v',''
echo "VERSION=$version" >> $env:GITHUB_ENV
- name: Update package.json version
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
npm version ${VERSION} --no-git-tag-version
else
npm version $VERSION --no-git-tag-version
fi
- name: Install Dependencies
run: npm ci
- name: Build Electron App
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npm run make
- name: Publish Release to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npm run publish

View File

@@ -24,6 +24,7 @@ const config: ForgeConfig = {
// /^\/node_modules/
],
extraResource: ['assets'],
icon: 'assets/icon', // Path to the icon file. Works for macOS and Windows, but not for Linux.
},
rebuildConfig: {},
makers: [
@@ -32,6 +33,18 @@ const config: ForgeConfig = {
new MakerRpm({}),
new MakerDeb({}),
],
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'neuronapp',
name: 'neuron',
},
prerelease: true,
}
}
],
plugins: [
new VitePlugin({
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.