2024-04-15 02:48:08 +00:00
|
|
|
name: "Build"
|
|
|
|
on:
|
|
|
|
push:
|
2024-04-16 06:10:31 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2024-04-15 02:48:08 +00:00
|
|
|
|
2024-04-17 10:27:08 +00:00
|
|
|
permissions: write-all
|
|
|
|
|
2024-04-15 02:48:08 +00:00
|
|
|
jobs:
|
|
|
|
build-linux:
|
2024-04-15 02:54:36 +00:00
|
|
|
if: ${{ startsWith(github.event.head_commit.message, 'build:') }}
|
2024-04-15 02:48:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target_platform: [linux,darwin]
|
|
|
|
target_arch: [x64, arm64]
|
|
|
|
steps:
|
|
|
|
- name: Clone Main Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-04-15 03:26:11 +00:00
|
|
|
repository: 'NapNeko/NapCatQQ'
|
2024-04-15 02:48:08 +00:00
|
|
|
submodules: true
|
2024-04-17 10:27:08 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-04-15 02:48:08 +00:00
|
|
|
- name: Use Node.js 20.X
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20.x
|
|
|
|
- name: Build NuCat Linux
|
|
|
|
run: |
|
|
|
|
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
|
|
|
npm run build:prod
|
|
|
|
cd dist
|
|
|
|
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
|
|
|
cd ..
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
|
|
|
|
path: dist
|
|
|
|
build-win32:
|
2024-04-15 02:54:36 +00:00
|
|
|
if: ${{ startsWith(github.event.head_commit.message, 'build:') }}
|
2024-04-15 02:48:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target_platform: [win32]
|
|
|
|
target_arch: [x64]
|
|
|
|
steps:
|
|
|
|
- name: Clone Main Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-04-15 03:26:11 +00:00
|
|
|
repository: 'NapNeko/NapCatQQ'
|
2024-04-15 02:48:08 +00:00
|
|
|
submodules: true
|
2024-04-17 10:27:08 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-04-15 02:48:08 +00:00
|
|
|
- name: Use Node.js 20.X
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20.x
|
|
|
|
- name: Build NuCat Linux
|
|
|
|
run: |
|
|
|
|
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
|
|
|
npm run build:prod
|
|
|
|
cd dist
|
|
|
|
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
|
|
|
cd ..
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
|
2024-04-17 10:27:08 +00:00
|
|
|
path: dist
|