Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
add build pipeline for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jk authored and jk committed Jul 30, 2020
1 parent c34ed38 commit f754251
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,43 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: electron-builder -p always --linux

build_on_windows:
runs-on: ubuntu-18.04
steps:
- uses: actions/[email protected]
with:
ref: refs/heads/master
- uses: actions/setup-node@master
with:
node-version: '12'
- name: set architecture
run: sudo dpkg --add-architecture i386
- name: update
run: sudo apt-get update
- name: install wine
run: sudo apt-get install wine32
- name: fetch jsign
run: curl https://zbay-binaries.s3.us-east-2.amazonaws.com/jsign/jsign-2.1.jar --output ./jsign-2.1.jar
- name: Add Windows certificate
id: write_file
uses: timheuer/base64-to-file@v1
with:
fileName: 'win-certificate.pfx'
encodedString: ${{ secrets.WIN_CSC_LINK }}
- name: fetch zcashd
run: mkdir ./zcash/win32 && curl https://zbay-binaries.s3.us-east-2.amazonaws.com/win32/zcashd.exe --output ./zcash/win32/zcashd.exe && chmod 755 ./zcash/win32/zcashd.exe
- name: install dependencies
run: npm install
- name: build on Windows
run: npm run build:prod
- name: install electron builder
run: npm install -g [email protected]
- name: release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CERTIFICATE_PATH: ${{ steps.write_file.outputs.filePath }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
WINDOWS_ALIAS: ${{ secrets.WINDOWS_ALIAS }}
USE_HARD_LINKS: false
run: electron-builder -p always --win
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"win": {
"target": "NSIS",
"sign": "sign.js",
"files": [
"dist/**/*",
"build/icon.*",
Expand Down Expand Up @@ -53,7 +54,7 @@
},
"homepage": "https://gitlab.rumblefishdev.com/holmes/zbay",
"@comment version": "To build new version for specific platform, just replace platform in version tag to one of following linux, mac, windows",
"version": "1.0.72-dev-2",
"version": "1.0.73-dev-2",
"description": "Distributed goods and bulletin board",
"main": "dist/main.js",
"scripts": {
Expand Down
18 changes: 18 additions & 0 deletions scripts/sign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exports.default = async function (configuration) {
console.log('config', configuration.path)
require('child_process').execSync(
`java \
-jar ./jsign-2.1.jar \
--keystore ${process.env.CERTIFICATE_PATH} \
--storepass ${process.env.WIN_CSC_KEY_PASSWORD} \
--storetype PKCS12 \
--tsaurl http://timestamp.digicert.com \
--alias ${process.env.WINDOWS_ALIAS} \
"${configuration.path}"
`,
{
stdio: 'inherit'
}
)
}

0 comments on commit f754251

Please sign in to comment.