diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..81bb721 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: "release" +on: + workflow_dispatch: + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: get version + run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV + - name: install app dependencies and build it + run: npm i && npm run dist + - name: Build/release Electron app + uses: samuelmeuli/action-electron-builder@v1 + with: + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ secrets.github_token }} + + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + # release: ${{ startsWith(github.ref, 'refs/tags/v') }} + # release: ${{ env.PACKAGE_VERSION }} + release: v1.0.0 diff --git a/icon/128x128.png b/icon/128x128.png new file mode 100644 index 0000000..1afa80b Binary files /dev/null and b/icon/128x128.png differ diff --git a/icon/128x128@2x.png b/icon/128x128@2x.png new file mode 100644 index 0000000..5435be2 Binary files /dev/null and b/icon/128x128@2x.png differ diff --git a/icon/16x16.png b/icon/16x16.png new file mode 100644 index 0000000..91d65a9 Binary files /dev/null and b/icon/16x16.png differ diff --git a/icon/16x16@2x.png b/icon/16x16@2x.png new file mode 100644 index 0000000..0246342 Binary files /dev/null and b/icon/16x16@2x.png differ diff --git a/icon/256x256.png b/icon/256x256.png new file mode 100644 index 0000000..5435be2 Binary files /dev/null and b/icon/256x256.png differ diff --git a/icon/256x256@2x.ico b/icon/256x256@2x.ico new file mode 100644 index 0000000..514e910 Binary files /dev/null and b/icon/256x256@2x.ico differ diff --git a/icon/256x256@2x.png b/icon/256x256@2x.png new file mode 100644 index 0000000..413c1e3 Binary files /dev/null and b/icon/256x256@2x.png differ diff --git a/icon/32x32.png b/icon/32x32.png new file mode 100644 index 0000000..0246342 Binary files /dev/null and b/icon/32x32.png differ diff --git a/icon/32x32@2x.png b/icon/32x32@2x.png new file mode 100644 index 0000000..8e90e74 Binary files /dev/null and b/icon/32x32@2x.png differ diff --git a/icon/512x512.png b/icon/512x512.png new file mode 100644 index 0000000..413c1e3 Binary files /dev/null and b/icon/512x512.png differ diff --git a/icon/512x512@2x.png b/icon/512x512@2x.png new file mode 100644 index 0000000..3f1fff0 Binary files /dev/null and b/icon/512x512@2x.png differ diff --git a/icon/icon.icns b/icon/icon.icns new file mode 100644 index 0000000..8df661d Binary files /dev/null and b/icon/icon.icns differ diff --git a/icon/icon.ico b/icon/icon.ico new file mode 100644 index 0000000..2509020 Binary files /dev/null and b/icon/icon.ico differ diff --git a/icon/icon.jpg b/icon/icon.jpg new file mode 100644 index 0000000..b662ce1 Binary files /dev/null and b/icon/icon.jpg differ diff --git a/icon/icon.png b/icon/icon.png new file mode 100644 index 0000000..413c1e3 Binary files /dev/null and b/icon/icon.png differ diff --git a/icon/logo.svg b/icon/logo.svg new file mode 100644 index 0000000..1599a99 --- /dev/null +++ b/icon/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon/source.png b/icon/source.png new file mode 100644 index 0000000..b662ce1 Binary files /dev/null and b/icon/source.png differ diff --git a/package.json b/package.json index e1c9b17..cb07a7e 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "description": "betterkonachan electron version", "main": "dist/main.js", "scripts": { - "dist": "npx rimraf dist/* && npm run main:build && npm run render:build && npm run copy && electron-builder --win --x64", + "dist": "npx rimraf dist/* && npm run main:build && npm run render:build && npm run copy && npm run copy:icon", "convert": "convert -density 512x512 -background transparent ./assets/image/icon.svg -define icon:auto-resize -colors 512 ./assets/image/icon.ico", "copy": "copyfiles -f ./assets/image/splash.svg ./assets/image/icon.ico dist", + "copy:icon": "copyfiles -f ./icon/* dist", "render:dev": "webpack-dev-server --inline --config ./webpack/render.dev.ts", "render:build": "webpack --config ./webpack/render.prod.ts", "lint": "eslint ./**/*.{ts,tsx,js}", @@ -15,7 +16,10 @@ "codecov": "codecov", "main:start": "electron .", "main:watch": "webpack --mode development --watch --config ./webpack/main.ts", - "main:build": "webpack --mode production --config ./webpack/main.ts" + "main:build": "webpack --mode production --config ./webpack/main.ts", + "postinstall": "electron-builder install-app-deps", + "build": "electron-builder --mac --windows --linux", + "release": "electron-builder --mac --windows --linux --publish always" }, "keywords": [ "betterkonachan", @@ -23,16 +27,25 @@ ], "author": "franciscowxp@github.com", "build": { - "appId": "BetterKonacha", + "appId": "Konachan", "files": [ "./dist/**/*" ], + "mac": { + "target": ["default"], + "category": "public.app-category.lifestyle", + "icon": "dist/icon.icns" + }, "win": { "target": [ "nsis", "zip" ], "icon": "dist/icon.ico" + }, + "linux": { + "target": ["AppImage"], + "category": "Office" } }, "pre-commit": [