Skip to content

Commit

Permalink
ci: improve linux ci
Browse files Browse the repository at this point in the history
  • Loading branch information
KotRikD committed Aug 1, 2024
1 parent 4d38dcc commit 0f74bd0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,34 @@ jobs:
- name: 🛠️ - Install Deps
run: npm install -g pnpm@^8 && pnpm install --frozen-lockfile

- name: 📦 - Build
run: pnpm build
- name: 📦 - Build (windows)
if: matrix.os == "windows-latest"
run: pnpm build:win

- name: 📦 - Build (linux)
if: matrix.os == "ubuntu-latest"
run: pnpm build:linux

- name: 🚀 - Upload artifacts for windows
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with: {
name: "tosu-${{ matrix.os }}-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}",
name: "tosu-windows-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}",
path: packages/tosu/dist/tosu.exe
}

- name: 🚀 - Upload artifacts for linux
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with: {
name: "${{ steps.set-artifact-name.outputs.ARTIFACT_NAME }}",
path: packages/tosu/dist/tosu.exe
}
name: "tosu-linux-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}",
path: packages/tosu/dist/tosu
}

# - name: 🚀 - Upload artifacts for mac
# if: matrix.os == 'macos-latest'
# uses: actions/upload-artifact@v3
# with: {
# name: "${{ steps.set-artifact-name.outputs.ARTIFACT_NAME }}",
# path: packages/tosu/dist/tosu.exe
# }
# }
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"prepare": "husky install",
"start": "pnpm run -C packages/tosu run:dev",
"build": "pnpm run -C packages/tosu compile",
"build:win": "pnpm run -C packages/tosu compile:win",
"build:linux": "pnpm run -C packages/tosu compile:linux",
"release": "standard-version",
"prettier:fix": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
"prettier:ci": "prettier --check \"**/*.{js,jsx,ts,tsx,css}\"",
Expand Down
3 changes: 2 additions & 1 deletion packages/tosu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"ts:compile": "ncc build src/index.ts -o dist -m -d",
"run:dev": "pnpm run genver && pnpm run ts:run src/index.ts",
"compile:prepare-htmls": "cp -rf node_modules/@tosu/server/assets ./dist",
"compile": "pnpm run genver && pnpm run ts:compile && pnpm run compile:prepare-htmls && pkg --output dist/tosu.exe --debug --config pkg.json --compress brotli dist/index.js && pnpm run ts:run src/postBuild.ts"
"compile:win": "pnpm run genver && pnpm run ts:compile && pnpm run compile:prepare-htmls && pkg --output dist/tosu.exe --debug --config pkg.win.json --compress brotli dist/index.js && pnpm run ts:run src/postBuild.ts",
"compile:linux": "pnpm run genver && pnpm run ts:compile && pnpm run compile:prepare-htmls && pkg --output dist/tosu --debug --config pkg.linux.json --compress brotli dist/index.js"
},
"dependencies": {
"@tosu/common": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/tosu/pkg.json → packages/tosu/pkg.linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dist/assets/**/*"
],
"targets": [
"node20-win-x64"
"node20-linux-x64"
],
"outputPath": "dist"
}
}
14 changes: 14 additions & 0 deletions packages/tosu/pkg.win.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scripts": "dist/**/*.js",
"assets": [
"dist/**/*.node",
"dist/**/*.wasm",
"dist/target/**/*",
"dist/_version.js",
"dist/assets/**/*"
],
"targets": [
"node20-win-x64"
],
"outputPath": "dist"
}

0 comments on commit 0f74bd0

Please sign in to comment.