Skip to content

Commit

Permalink
elctron-builder build file
Browse files Browse the repository at this point in the history
  • Loading branch information
hmt committed Feb 28, 2020
1 parent 966bd44 commit a7a0229
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 32 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
name: Build and release bangbib
on: push
on:
push:
branches:
- '**'
tags-ignore:
- '*.*.*'
jobs:
release:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
os: [windows-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-node-
- name: Install Node.js, NPM
uses: actions/setup-node@v1
with:
node-version: 13
- name: Install Dependencies
run: npm install
- name: Build
env:
THE_AUTHOR: ${{ secrets.AUTHOR }}
THE_EMAIL: ${{ secrets.EMAIL }}
run: npm run build -m
- name: Package
run: npm run dist
- name: show dir
run: ls dist
- uses: actions/upload-artifact@v1
with:
name: bangbib
path: "./dist"
- uses: ncipollo/release-action@v1
with:
artifact: "./dist/bangbib.msi"
artifacts: "./dist/bangbib.msi,./dist/bangbib.dmg,./dist/bangbib.AppImage,./dist/bangbib.snap"
allowUpdates: true
tag: v1.0.${{ github.run_number }}
token: ${{ secrets.GITHUB_TOKEN }}
Binary file removed build/icons/png/128x128.png
Binary file not shown.
Binary file removed build/icons/png/16x16.png
Binary file not shown.
Binary file removed build/icons/png/24x24.png
Binary file not shown.
Binary file removed build/icons/png/256x256.png
Binary file not shown.
Binary file removed build/icons/png/32x32.png
Binary file not shown.
Binary file removed build/icons/png/48x48.png
Binary file not shown.
Binary file removed build/icons/png/512x512.png
Binary file not shown.
Binary file removed build/icons/png/64x64.png
Binary file not shown.
42 changes: 42 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
appId: im.hmt.bangbib
productName: bangbib
artifactName: bangbib.${ext}
buildVersion: 1.0.${env.GITHUB_RUN_NUMBER}
copyright: Copyright ${author}

extraMetadata:
author:
name: ${env.THE_AUTHOR}
email: ${env.THE_EMAIL}

files:
- ./build/**/*

win:
icon: icons/icon.ico
target: msi

linux:
icon: icons/icon.png
category: app.tools
executableName: bangbib
target:
- AppImage
- snap

mac:
icon: icons/icon.icns
target: dmg

dmg:
icon: icons/icon.icns
contents:
- x: 130
y: 220
- x: 550
y: 22
type: link
path: /Applications
window:
width: 680
height: 42
File renamed without changes.
File renamed without changes.
File renamed without changes
16 changes: 0 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@
"dev:electron": "electron .",
"postinstall": "electron-builder install-app-deps"
},
"build": {
"appId": "im.hmt.bangbib",
"productName": "bangbib",
"artifactName": "bangbib.${ext}",
"files": [
"./build/**/*"
],
"win": {
"icon": "icons/win/icon.ico",
"target": [
{
"target": "msi"
}
]
}
},
"devDependencies": {
"electron": "^8.0.2",
"electron-builder": "^22.3.2",
Expand Down

0 comments on commit a7a0229

Please sign in to comment.