diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb4e1bd..333bf32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,26 +1,30 @@ 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: @@ -28,18 +32,17 @@ jobs: - 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 }} diff --git a/build/icons/png/128x128.png b/build/icons/png/128x128.png deleted file mode 100644 index fddb0dc..0000000 Binary files a/build/icons/png/128x128.png and /dev/null differ diff --git a/build/icons/png/16x16.png b/build/icons/png/16x16.png deleted file mode 100644 index 6b59dfe..0000000 Binary files a/build/icons/png/16x16.png and /dev/null differ diff --git a/build/icons/png/24x24.png b/build/icons/png/24x24.png deleted file mode 100644 index 7231e5f..0000000 Binary files a/build/icons/png/24x24.png and /dev/null differ diff --git a/build/icons/png/256x256.png b/build/icons/png/256x256.png deleted file mode 100644 index 35fca32..0000000 Binary files a/build/icons/png/256x256.png and /dev/null differ diff --git a/build/icons/png/32x32.png b/build/icons/png/32x32.png deleted file mode 100644 index 1ce81f5..0000000 Binary files a/build/icons/png/32x32.png and /dev/null differ diff --git a/build/icons/png/48x48.png b/build/icons/png/48x48.png deleted file mode 100644 index 73af1e2..0000000 Binary files a/build/icons/png/48x48.png and /dev/null differ diff --git a/build/icons/png/512x512.png b/build/icons/png/512x512.png deleted file mode 100644 index 5e46ef0..0000000 Binary files a/build/icons/png/512x512.png and /dev/null differ diff --git a/build/icons/png/64x64.png b/build/icons/png/64x64.png deleted file mode 100644 index eb701d2..0000000 Binary files a/build/icons/png/64x64.png and /dev/null differ diff --git a/electron-builder.yml b/electron-builder.yml new file mode 100644 index 0000000..3ca5ce3 --- /dev/null +++ b/electron-builder.yml @@ -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 diff --git a/build/icons/mac/icon.icns b/icons/icon.icns similarity index 100% rename from build/icons/mac/icon.icns rename to icons/icon.icns diff --git a/build/icons/win/icon.ico b/icons/icon.ico similarity index 100% rename from build/icons/win/icon.ico rename to icons/icon.ico diff --git a/build/icons/png/1024x1024.png b/icons/icon.png similarity index 100% rename from build/icons/png/1024x1024.png rename to icons/icon.png diff --git a/package.json b/package.json index 3109a1b..77d721e 100644 --- a/package.json +++ b/package.json @@ -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",