Skip to content

Commit

Permalink
Add CICD for macos (#221)
Browse files Browse the repository at this point in the history
Co-authored-by: Hien To <[email protected]>
  • Loading branch information
2 people authored and Hien To committed Sep 28, 2023
1 parent 1c79b93 commit 64a50e0
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 114 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/ci-production.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/ci-staging.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/macos-build-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Jan Build MacOS App

on:
push:
tags: ['v*.*.*']

jobs:
build-macos-app:
runs-on: macos-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
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: Build and publish app
run: |
yarn build:publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ Note: This instruction is tested on MacOS only.

```
yarn install
# Packing base plugins
yarn build:plugins
```

4. **Run development and Using Jan Desktop**
Expand All @@ -108,6 +111,7 @@ Note: This instruction is tested on MacOS only.
git clone https://github.com/janhq/jan
cd jan
yarn install
yarn build:plugins

# Build the app
yarn build
Expand All @@ -123,7 +127,7 @@ Contributions are welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md) fi

```sh
# From the root, run:
yarn
yarn install

yarn build:plugins

Expand Down
4 changes: 2 additions & 2 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"scripts": {
"dev": "tsc -p . && electron .",
"build": "tsc -p . && electron-builder -p never -mwl",
"build:publish": "tsc -p . && electron-builder -p onTagOrDraft -mwl",
"build": "tsc -p . && electron-builder -p never -mw",
"build:publish": "tsc -p . && electron-builder -p onTagOrDraft -mw",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
Expand Down

0 comments on commit 64a50e0

Please sign in to comment.