-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature CICD for MacOS and Windows (janhq#263)
* Separate CICD into multi platform * Update yarn script to build multi-platform and arch --------- Co-authored-by: Hien To <[email protected]> Co-authored-by: Hien To <>
- Loading branch information
Showing
9 changed files
with
189 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
name: Jan Build MacOS App | ||
|
||
on: | ||
push: | ||
tags: ['v*.*.*'] | ||
|
||
jobs: | ||
build-macos: | ||
runs-on: macos-latest | ||
environment: production | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Getting the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Installing node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install jq | ||
uses: dcarbone/[email protected] | ||
|
||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
|
||
- name: Update app version base on tag | ||
run: | | ||
if [[ ! "${VERSION_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Error: Tag is not valid!" | ||
exit 1 | ||
fi | ||
jq --arg version "${VERSION_TAG#v}" '.version = $version' electron/package.json > /tmp/package.json | ||
mv /tmp/package.json electron/package.json | ||
env: | ||
VERSION_TAG: ${{ steps.tag.outputs.tag }} | ||
|
||
- name: Install yarn dependencies | ||
run: | | ||
yarn install | ||
yarn build:plugins | ||
- name: Get Cer for code signing | ||
run: base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12 | ||
shell: bash | ||
env: | ||
CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }} | ||
|
||
- name: Build and publish app | ||
run: | | ||
yarn build:publish-darwin | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CSC_LINK: "/tmp/codesign.p12" | ||
CSC_KEY_PASSWORD: ${{ secrets.CODE_SIGN_P12_PASSWORD }} | ||
CSC_IDENTITY_AUTO_DISCOVERY: "true" | ||
|
||
build-windows-x64: | ||
runs-on: windows-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Getting the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Installing node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install jq | ||
uses: dcarbone/[email protected] | ||
|
||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
|
||
- name: Update app version base on tag | ||
shell: bash | ||
run: | | ||
if [[ ! "${VERSION_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Error: Tag is not valid!" | ||
exit 1 | ||
fi | ||
jq --arg version "${VERSION_TAG#v}" '.version = $version' electron/package.json > /tmp/package.json | ||
mv /tmp/package.json electron/package.json | ||
env: | ||
VERSION_TAG: ${{ steps.tag.outputs.tag }} | ||
|
||
- name: Install yarn dependencies | ||
run: | | ||
yarn config set network-timeout 300000 | ||
yarn install | ||
yarn build:plugins | ||
- name: Build and publish app | ||
run: | | ||
yarn build:publish-win32 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-linux-x64: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Getting the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Installing node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install jq | ||
uses: dcarbone/[email protected] | ||
|
||
- name: Install Snapcraft | ||
uses: samuelmeuli/action-snapcraft@v2 | ||
|
||
- name: Get tag | ||
id: tag | ||
uses: dawidd6/action-get-tag@v1 | ||
|
||
- name: Update app version base on tag | ||
run: | | ||
if [[ ! "${VERSION_TAG}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Error: Tag is not valid!" | ||
exit 1 | ||
fi | ||
jq --arg version "${VERSION_TAG#v}" '.version = $version' electron/package.json > /tmp/package.json | ||
mv /tmp/package.json electron/package.json | ||
env: | ||
VERSION_TAG: ${{ steps.tag.outputs.tag }} | ||
|
||
- name: Install yarn dependencies | ||
run: | | ||
yarn config set network-timeout 300000 | ||
yarn install | ||
yarn build:plugins | ||
- name: Build and publish app | ||
run: | | ||
yarn build:publish-linux | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "jan-electron", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"main": "./build/main.js", | ||
"author": "Jan", | ||
"author": "Jan <[email protected]>", | ||
"license": "MIT", | ||
"homepage": "./", | ||
"build": { | ||
|
@@ -12,7 +12,8 @@ | |
"renderer/**/*", | ||
"build/*.{js,map}", | ||
"build/**/*.{js,map}", | ||
"core/pre-install" | ||
"core/pre-install", | ||
"core/plugin-manager/facade" | ||
], | ||
"asarUnpack": [ | ||
"core/pre-install" | ||
|
@@ -32,9 +33,14 @@ | |
"scripts": { | ||
"lint": "eslint . --ext \".js,.jsx,.ts,.tsx\"", | ||
"dev": "tsc -p . && electron .", | ||
"build": "tsc -p . && electron-builder -p never -mw", | ||
"build:publish": "tsc -p . && electron-builder -p onTagOrDraft -mw", | ||
"postinstall": "electron-builder install-app-deps" | ||
"build": "tsc -p . && electron-builder -p never -m", | ||
"build:darwin": "tsc -p . && electron-builder -p never -m --x64 --arm64", | ||
"build:win32": "tsc -p . && electron-builder -p never -w", | ||
"build:linux": "tsc -p . && electron-builder -p never --linux deb", | ||
"build:publish": "tsc -p . && electron-builder -p onTagOrDraft -m", | ||
"build:publish-darwin": "tsc -p . && electron-builder -p onTagOrDraft -m --x64 --arm64", | ||
"build:publish-win32": "tsc -p . && electron-builder -p onTagOrDraft -w", | ||
"build:publish-linux": "tsc -p . && electron-builder -p onTagOrDraft --linux deb " | ||
}, | ||
"dependencies": { | ||
"@npmcli/arborist": "^7.1.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters