Skip to content

Commit

Permalink
# CWPBD-153 * update build options
Browse files Browse the repository at this point in the history
  • Loading branch information
yanjiaxuan committed May 26, 2021
1 parent 6265d26 commit 0e87aa3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 81 deletions.
82 changes: 11 additions & 71 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,29 @@
# Workflow's name
name: Build TOMATOX For Win/Mac/Linux

# Workflow's trigger
on:
push:
tags:
- 'v*.*.*'
- v*.*.*

# Workflow's jobs
jobs:
# job's id
release:
# job's name
name: build and release TOMATOX

# the type of machine to run the job on
name: publish tomatox job
runs-on: ${{ matrix.os }}

# create a build matrix for jobs
strategy:
fail-fast: false
matrix:
os: [windows-2019, macos-10.15, ubuntu-18.04]
os: [windows-latest, macos-latest, ubuntu-latest]

# create steps
steps:
# step1: check out repository
- name: Check out git repository
uses: actions/checkout@v2

# step2: install node env
- name: Install Node.js
uses: actions/setup-node@v2-beta

# step3: npm install
- name: npm install
run: |
npm install
# step4: build app for mac/win
- name: build windows app
if: matrix.os == 'windows-2019'
run: |
npm run pack
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build mac app
if: matrix.os == 'macos-10.15'
run: |
npm run pack
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build Ubuntu app
if: matrix.os == 'ubuntu-18.04'
run: |
npm run pack
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# step5: cleanup artifacts in dist_electron
- name: cleanup artifacts for windows
if: matrix.os == 'windows-2019'
run: |
mkdir artifacts
mv release/*.exe artifacts || true
- name: cleanup artifacts for macos
if: matrix.os == 'macos-10.15'
run: |
mkdir artifacts
mv release/*.dmg artifacts || true
- name: cleanup artifacts for Ubuntu
if: matrix.os == 'ubuntu-18.04'
run: |
mkdir artifacts
mv release/*.dmg artifacts || true
# step6: upload artifacts
- name: upload artifacts
uses: actions/upload-artifact@v2
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
name: ${{ matrix.os }}
path: artifacts
node-version: 12

# step7: create release
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: 'artifacts/**'
- run: |
npm i
npm run publish
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,9 @@
"package.json"
],
"win": {
"icon": "./public/icon.ico",
"icon": "./public/icon.png",
"target": [
{
"target": "nsis",
"arch": [
"ia32"
]
}
"nsis"
]
},
"linux": {
Expand All @@ -99,9 +94,9 @@
]
},
"nsis": {
"installerIcon": "./public/icon.ico",
"installerHeaderIcon": "./public/icon.ico",
"uninstallerIcon": "./public/icon.ico",
"installerIcon": "./public/icon.png",
"installerHeaderIcon": "./public/icon.png",
"uninstallerIcon": "./public/icon.png",
"uninstallDisplayName": "TOMATOX",
"oneClick": false,
"allowToChangeInstallationDirectory": true,
Expand Down

0 comments on commit 0e87aa3

Please sign in to comment.