Skip to content

Commit

Permalink
Merge pull request ohmplatform#37 from ohmplatform/ci/cd
Browse files Browse the repository at this point in the history
ci/cd added
  • Loading branch information
bhattaraijay05 authored Apr 17, 2023
2 parents b9d9aef + e7b515b commit c2bcde4
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 31 deletions.
122 changes: 122 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Package and Release

on:
push:
tags:
- v*

jobs:
build-macArm:
name: Build (macos-latest)
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
strategy:
matrix:
os: [macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 18.x
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: Yarn install
run: yarn install
- name: Add MacOS certs
if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/')
run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Make
if: startsWith(github.ref, 'refs/tags/')
run: yarn make-macArm
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
files: |
**/*.dmg
**/*.zip
build-macIntel:
name: Build (macos-latest)
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
strategy:
matrix:
os: [macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 18.x
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: Yarn install
run: yarn install
- name: Add MacOS certs
if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/')
run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Make
if: startsWith(github.ref, 'refs/tags/')
run: yarn make-macIntel
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
files: |
**/*.dmg
**/*.zip
build-windows:
name: Build (windows-latest)
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 18.x
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: Yarn install
run: yarn install
- name: Add Windows certificate
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/')
id: write_file
uses: timheuer/base64-to-file@v1
with:
fileName: "win-certificate.pfx"
encodedString: ${{ secrets.CERTIFICATE_WINDOWS_PFX }}
- name: Make
if: startsWith(github.ref, 'refs/tags/')
run: yarn make-win
env:
WINDOWS_PFX_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
files: |
**/*Setup.exe
**/*.nupkg
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pids
.env
devconst.ts
keys
macbuild

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand Down
7 changes: 6 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

![GitHub All Releases](https://img.shields.io/github/downloads/ohmplatform/freedom-gpt-electron-app/total.svg)

# Join our Discord Community

Join our Discord Server to get the latest updates and to interact with the community.

[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/Rdgn4v9j)

## Introduction

This is the repository for the Freedom GPT application. This application is built using
Expand Down Expand Up @@ -80,7 +86,6 @@ yarn start

https://user-images.githubusercontent.com/54356944/231952507-94ef7335-4238-43ee-8c45-677f6cd48988.mov


# Credits

This project utilizes several open-source packages and libraries, without which this project would not have been possible:
Expand Down
23 changes: 23 additions & 0 deletions add-osx-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env sh

KEY_CHAIN=build.keychain
CERTIFICATE_P12=certificate.p12

# Recreate the certificate from the secure environment variable
echo $CERTIFICATE_OSX_APPLICATION | base64 --decode > $CERTIFICATE_P12

#create a keychain
security create-keychain -p actions $KEY_CHAIN

# Make the keychain the default so identities are found
security default-keychain -s $KEY_CHAIN

# Unlock the keychain
security unlock-keychain -p actions $KEY_CHAIN

security import $CERTIFICATE_P12 -k $KEY_CHAIN -P $CERTIFICATE_PASSWORD -T /usr/bin/codesign;

security set-key-partition-list -S apple-tool:,apple: -s -k actions $KEY_CHAIN

# remove certs
rm -fr *.p12
33 changes: 5 additions & 28 deletions forge.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import MakerDMG from "@electron-forge/maker-dmg";
import MakerWix from "@electron-forge/maker-wix";
import MakerZIP from "@electron-forge/maker-zip";
import MakerSquirrel from "@electron-forge/maker-squirrel";
import MakerZIP from "@electron-forge/maker-zip";
import { WebpackPlugin } from "@electron-forge/plugin-webpack";
import type { ForgeConfig } from "@electron-forge/shared-types";
import * as dotenv from "dotenv";
import { mainConfig } from "./webpack.main.config";
import { rendererConfig } from "./webpack.renderer.config";
import * as dotenv from "dotenv";
dotenv.config();

const config: ForgeConfig = {
Expand All @@ -17,7 +16,7 @@ const config: ForgeConfig = {
: "./src/appicons/icons/mac/ico",
extraResource: "./src/models",
osxSign: {
identity: process.env.APPLE_IDENTITY,
identity: "Developer ID Application: Age of AI, LLC (TS4W464GMN)",
optionsForFile: () => {
return {
entitlements: "./macbuild/entitlements.mac.plist",
Expand All @@ -28,7 +27,7 @@ const config: ForgeConfig = {
tool: "notarytool",
appleId: process.env.APPLE_ID as string,
appleIdPassword: process.env.APPLE_ID_PASSWORD as string,
teamId: process.env.APPLE_TEAM_ID as string,
teamId: "TS4W464GMN",
},
},
publishers: [
Expand All @@ -49,34 +48,12 @@ const config: ForgeConfig = {
makers: [
new MakerZIP({}, ["darwin"]),
new MakerDMG({}, ["darwin"]),

// new MakerWix(
// {
// name: "FreedomGPT",
// description: "FreedomGPT",
// manufacturer: process.env.MANUFACTURER_NAME as string,
// ui: {
// chooseDirectory: true,
// },
// icon: "./src/appicons/icons/win/icon.ico",
// certificateFile: "./keys/certificate.pfx",
// certificatePassword: process.env.WIN_CERTIFICATE_PASSWORD as string,
// },
// ["win32"]
// ),
new MakerSquirrel(
{
name: "FreedomGPT",
description: "FreedomGPT",
authors: process.env.MANUFACTURER_NAME as string,
setupIcon: "./src/appicons/icons/win/icon.ico",
certificateFile: "./keys/certificate.pfx",
certificateFile: process.env.WINDOWS_PFX_FILE as string,
certificatePassword: process.env.WIN_CERTIFICATE_PASSWORD as string,
iconUrl:
"https://raw.githubusercontent.com/ohmplatform/FreedomGPT/main/src/appicons/icons/win/icon.ico",
owners: process.env.MANUFACTURER_NAME as string,
title: "FreedomGPT",
copyright: process.env.MANUFACTURER_NAME as string,
},
["win32"]
),
Expand Down
15 changes: 15 additions & 0 deletions macbuild/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
</dict>
</plist>
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx ."
"lint": "eslint --ext .ts,.tsx .",
"make-win": "electron-forge make --platform=win32",
"make-macArm": "electron-forge make --platform=darwin --arch=arm64",
"make-macIntel": "electron-forge make --platform=darwin --arch=x64",
"push": "yarn version --patch && git push --follow-tags"
},
"keywords": [],
"author": {
Expand Down
Binary file removed video.mp4
Binary file not shown.

0 comments on commit c2bcde4

Please sign in to comment.