Skip to content

Commit

Permalink
chore: auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
ykwen committed Dec 17, 2023
1 parent 02ef286 commit c61fee3
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 43 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]

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

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

- name: Install dependencies
run: npm install

- name: Build Mac Electron package
if: ${{ matrix.os == 'macos-latest' }}
run: npm run build:mac
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}

- name: Build Windows Electron package
if: ${{ matrix.os == 'windows-latest' }}
run: npm run build:win
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Publish release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: gh release edit ${{ github.ref_name }} --draft=false
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}

# - name: Create release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# token: ${{ secrets.RELEASE_TOKEN }}
# files: |
# ./release/${{ github.ref }}/GemChat-Windows-${{ github.ref }}-Setup.exe
70 changes: 33 additions & 37 deletions electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,43 @@
* @see https://www.electron.build/configuration/configuration
*/
{
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
"appId": "YourAppID",
"asar": true,
"productName": "Super ChatGPT",
"directories": {
"output": "release/${version}"
$schema: 'https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json',
appId: 'YourAppID',
asar: true,
productName: 'GemChat',
directories: {
output: 'release/${version}',
},
"files": [
"dist",
"dist-electron"
],
"mac": {
"target": [
"dmg"
],
"icon": "public/logo.png",
"artifactName": "${productName}-Mac-${version}-Installer.${ext}"
files: ['dist', 'dist-electron'],
mac: {
target: ['default'],
icon: 'public/logo.png',
artifactName: '${productName}-Mac-${version}-Installer.${ext}',
},
"win": {
"target": [
win: {
target: [
{
"target": "nsis",
"arch": [
"x64"
]
}
target: 'nsis',
arch: ['x64'],
},
],
"icon": "public/logo.png",
"artifactName": "${productName}-Windows-${version}-Setup.${ext}"
icon: 'public/logo.png',
artifactName: '${productName}-Windows-${version}-Setup.${ext}',
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": false
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false,
},
linux: {
target: ['AppImage'],
icon: 'public/logo.png',
artifactName: '${productName}-Linux-${version}.${ext}',
},
publish: {
provider: 'github',
owner: 'wenyikun',
repo: 'chat-electron-app',
},
"linux": {
"target": [
"AppImage"
],
"icon": "public/logo.png",
"artifactName": "${productName}-Linux-${version}.${ext}"
}
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Super ChatGPT</title>
<title>GemChat</title>
</head>
<body>
<div id="app"></div>
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "chat-electron-app",
"private": true,
"version": "0.3.0",
"version": "0.3.1",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build && electron-builder --win",
"build:mac": "vue-tsc && vite build && electron-builder --mac",
"build:win": "vue-tsc && vite build && electron-builder --win",
"preview": "vite preview"
},
"dependencies": {
Expand Down
10 changes: 7 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ export default defineConfig({
presetUno(),
presetAttributify()
],
include: ["./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
"./node_modules/primevue/**/*.{vue,js,ts,jsx,tsx}"]
content: {
pipeline: {
include: ["./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
"./node_modules/primevue/**/*.{vue,js,ts,jsx,tsx}"]
}
}
})
],
})

0 comments on commit c61fee3

Please sign in to comment.