Skip to content

Commit

Permalink
Merge branch 'chore/ci-cache-npm-with-nexus' of github.com:janhq/jan …
Browse files Browse the repository at this point in the history
…into chore/ci-cache-npm-with-nexus
  • Loading branch information
hientominh committed Mar 29, 2024
2 parents 96639d0 2bb7cf0 commit 0e4d97c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3,519 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/jan-electron-linter-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 67,9 @@ jobs:
make test
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"
TURBO_API: "${{ secrets.TURBO_API }}"
TURBO_TEAM: "macos"
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"

test-on-windows:
if: github.event_name == 'push'
Expand Down Expand Up @@ -106,6 109,10 @@ jobs:
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global
make test
env:
TURBO_API: "${{ secrets.TURBO_API }}"
TURBO_TEAM: "windows"
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
test-on-windows-pr:
if: github.event_name == 'pull_request'
runs-on: windows-desktop-default-windows-security
Expand Down Expand Up @@ -140,6 147,10 @@ jobs:
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global
make test
env:
TURBO_API: "${{ secrets.TURBO_API }}"
TURBO_TEAM: "windows"
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"

test-on-ubuntu:
runs-on: [self-hosted, Linux, ubuntu-desktop]
Expand Down Expand Up @@ -171,3 182,7 @@ jobs:
npm config set registry https://nexus.jan.ai/repository/jan-npm/ --global
yarn config set registry https://nexus.jan.ai/repository/jan-npm/ --global
make test
env:
TURBO_API: "${{ secrets.TURBO_API }}"
TURBO_TEAM: "linux"
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 53,24 @@ build: check-file-counts

clean:
ifeq ($(OS),Windows_NT)
powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out -Recurse -Directory | Remove-Item -Recurse -Force"
powershell -Command "Get-ChildItem -Path . -Include package-lock.json -Recurse -File | Remove-Item -Recurse -Force"
powershell -Command "Remove-Item -Recurse -Force ./pre-install/*.tgz"
powershell -Command "Remove-Item -Recurse -Force ./electron/pre-install/*.tgz"
powershell -Command "if (Test-Path \"$($env:USERPROFILE)\jan\extensions\") { Remove-Item -Path \"$($env:USERPROFILE)\jan\extensions\" -Recurse -Force }"
-powershell -Command "Get-ChildItem -Path . -Include node_modules, .next, dist, build, out, .turbo -Recurse -Directory | Remove-Item -Recurse -Force"
-powershell -Command "Get-ChildItem -Path . -Include package-lock.json -Recurse -File | Remove-Item -Recurse -Force"
-powershell -Command "Get-ChildItem -Path . -Include yarn.lock -Recurse -File | Remove-Item -Recurse -Force"
-powershell -Command "Remove-Item -Recurse -Force ./pre-install/*.tgz"
-powershell -Command "Remove-Item -Recurse -Force ./extensions/*/*.tgz"
-powershell -Command "Remove-Item -Recurse -Force ./electron/pre-install/*.tgz"
-powershell -Command "if (Test-Path \"$($env:USERPROFILE)\jan\extensions\") { Remove-Item -Path \"$($env:USERPROFILE)\jan\extensions\" -Recurse -Force }"
else ifeq ($(shell uname -s),Linux)
find . -name "node_modules" -type d -prune -exec rm -rf '{}'
find . -name ".next" -type d -exec rm -rf '{}'
find . -name "dist" -type d -exec rm -rf '{}'
find . -name "build" -type d -exec rm -rf '{}'
find . -name "out" -type d -exec rm -rf '{}'
find . -name ".turbo" -type d -exec rm -rf '{}'
find . -name "packake-lock.json" -type f -exec rm -rf '{}'
find . -name "yarn.lock" -type f -exec rm -rf '{}'
rm -rf ./pre-install/*.tgz
rm -rf ./extensions/*/*.tgz
rm -rf ./electron/pre-install/*.tgz
rm -rf "~/jan/extensions"
rm -rf "~/.cache/jan*"
Expand All @@ -75,8 80,11 @@ else
find . -name "dist" -type d -exec rm -rf '{}'
find . -name "build" -type d -exec rm -rf '{}'
find . -name "out" -type d -exec rm -rf '{}'
find . -name ".turbo" -type d -exec rm -rf '{}'
find . -name "packake-lock.json" -type f -exec rm -rf '{}'
find . -name "yarn.lock" -type f -exec rm -rf '{}'
rm -rf ./pre-install/*.tgz
rm -rf ./extensions/*/*.tgz
rm -rf ./electron/pre-install/*.tgz
rm -rf ~/jan/extensions
rm -rf ~/Library/Caches/jan*
Expand Down
5 changes: 3 additions & 2 deletions extensions/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 2,11 @@
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"outputs": [".dist/**", "*.tgz"]
"outputs": ["dist/**", "*.tgz"]
},
"build:publish": {
"dependsOn": ["^build"]
"dependsOn": ["^build"],
"outputs": ["../../pre-install/*.tgz"]
},
"dev": {
"cache": false
Expand Down
Loading

0 comments on commit 0e4d97c

Please sign in to comment.