Skip to content

Commit

Permalink
- feature: added cicd for production (#131)
Browse files Browse the repository at this point in the history
* - feature: added cicd for production visor

* - fix: reverted hardcoded envs
  • Loading branch information
agallardol authored Feb 1, 2024
1 parent 21e5022 commit 68183d1
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release production

on:
push:
branches:
- 'main'
tags:
- '[0-9]+.[0-9]+.[0-9]+'

defaults:
run:
working-directory: ./

jobs:
release-shinkai-visor:
runs-on: ubuntu-latest
environment: production
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node version
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: false
registry-url: https://registry.npmjs.org
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install dependencies
run: |
npm cache verify
npm ci --no-audit --prefer-offline
- name: Run NX build on shinkai-visor
run: npx nx build shinkai-visor --skip-nx-cache
env:
VERSION: ${{ github.ref }}.${{github.run_number}}
NAME_PREFIX: ''
DESCRIPTION_PREFIX: ''
PUBLIC_KEY: ${{ secrets.CHROME_EXTENSION_PUBLIC_KEY }}

- name: Zip extension
run: cd ./dist/apps && zip -r shinkai-visor.zip shinkai-visor

- name: Upload & Release
uses: mnao305/[email protected]
with:
file-path: dist/apps/shinkai-visor.zip
extension-id: ${{ secrets.CHROME_EXTENSION_ID }}
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish: false
9 changes: 8 additions & 1 deletion apps/shinkai-visor/dynamic-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ const getDescription = () => {
}`;
};

const getPublicKey = () => {
return (
process.env.PUBLIC_KEY ||
'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgdEOqEQpJXJIfmVTNW9NELXqA4yE2WoGo6C7ssQSW9oWiGugLRyUp1EeZ1xQSMaIN08yppKkn49QrTDo73/myuxP94LJ/vZN4rVuEYkzWUfKEv4bSABPkUkhNygddf22iXvfKpQkMzLnmXiKetS6k0NYDoz5GT8oVO2HxmQOgCJpX7wq6W0SzntqmUp5zN2FEh6rcZd20evL1HpxBA4ZylWmiS3n2pMfzCoR37YYaUlwE8Og+6RtuZIR3XaBKo7g3AG4vPi+TO5Jk4hjybYHtA38fBn6Gc5LEahywnJcoLTTSHEQ4hvylHgvlC9RpI8p121cRSmK2ycTuKpVBoRKMwIDAQAB'
);
};

export const dynamicManifest = defineManifest((env) => {
return {
...baseManifestJson,
version: getVersion(),
name: getName(),
description: getDescription(),
key: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgdEOqEQpJXJIfmVTNW9NELXqA4yE2WoGo6C7ssQSW9oWiGugLRyUp1EeZ1xQSMaIN08yppKkn49QrTDo73/myuxP94LJ/vZN4rVuEYkzWUfKEv4bSABPkUkhNygddf22iXvfKpQkMzLnmXiKetS6k0NYDoz5GT8oVO2HxmQOgCJpX7wq6W0SzntqmUp5zN2FEh6rcZd20evL1HpxBA4ZylWmiS3n2pMfzCoR37YYaUlwE8Og+6RtuZIR3XaBKo7g3AG4vPi+TO5Jk4hjybYHtA38fBn6Gc5LEahywnJcoLTTSHEQ4hvylHgvlC9RpI8p121cRSmK2ycTuKpVBoRKMwIDAQAB',
key: getPublicKey(),
};
});

0 comments on commit 68183d1

Please sign in to comment.