Skip to content

Commit

Permalink
refactor: github action for auto build
Browse files Browse the repository at this point in the history
  • Loading branch information
Sloaix committed Aug 11, 2023
1 parent c5d6dc5 commit 64e874e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Build & Release Electron app
run: pnpm build
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
19 changes: 11 additions & 8 deletions electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
appId: 'com.sloaix.tor',
asar: true,
directories: {
output: 'release/${version}'
output: 'release/v${version}'
},
files: ['dist-electron', 'dist'],
mac: {
artifactName: '${productName}_${version}.${ext}',
target: ['dmg', 'zip']
artifactName: '${productName}-${arch}-v${version}.${ext}',
target: ['dmg']
},
win: {
target: [
Expand All @@ -19,17 +19,20 @@
arch: ['x64']
}
],
artifactName: '${productName}_${version}.${ext}'
artifactName: '${productName}-${arch}-v${version}.${ext}'
},
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false
deleteAppDataOnUninstall: true
},
publish: {
provider: 'generic',
channel: 'latest',
url: 'https://github.com/sloaix/tor/releases/download/v${version}'
provider: 'github',
repo: 'tor',
owner: 'Sloaix',
releaseType: 'release',
vPrefixedTagName: true,
publishAutoUpdate: true
}
}

0 comments on commit 64e874e

Please sign in to comment.