NapCatQQ/.github/workflows/build.yml

75 lines
2.2 KiB
YAML
Raw Normal View History

2024-04-15 02:48:08 +00:00
name: "Build"
on:
2024-04-28 10:44:32 +00:00
workflow_dispatch:
2024-04-15 02:48:08 +00:00
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:
2024-04-27 16:02:26 +00:00
target_platform: [linux]
2024-04-15 02:48:08 +00:00
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-28 12:53:34 +00:00
ref: main
2024-04-27 15:50:34 +00:00
token: ${{ secrets.NAPCAT_BUILD }}
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]
2024-06-17 02:03:59 +00:00
target_arch: [x64,ia32]
2024-04-15 02:48:08 +00:00
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-28 12:53:34 +00:00
ref: main
2024-04-27 15:50:34 +00:00
token: ${{ secrets.NAPCAT_BUILD }}
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