NapCatQQ/.github/workflows/release.yml

103 lines
3.0 KiB
YAML
Raw Normal View History

2024-04-14 16:22:46 +00:00
name: "release"
2024-04-14 16:09:08 +00:00
on:
2024-04-14 16:52:59 +00:00
workflow_dispatch:
2024-04-14 16:09:08 +00:00
push:
tags:
- "v*"
jobs:
2024-04-14 16:22:46 +00:00
build-linux:
2024-04-14 16:09:08 +00:00
runs-on: ubuntu-latest
2024-04-14 16:22:46 +00:00
strategy:
fail-fast: false
matrix:
target_platform: [linux,darwin]
target_arch: [x64, arm64]
2024-04-14 16:09:08 +00:00
steps:
2024-04-14 16:22:46 +00:00
- name: Clone Main Repository
uses: actions/checkout@v4
2024-04-14 16:09:08 +00:00
with:
2024-04-14 16:22:46 +00:00
repository: 'NapNeko/NapCat'
submodules: true
token: ${{ secrets.NAPCAT_BUILD }}
- 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:
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:
repository: 'NapNeko/NapCat'
submodules: true
token: ${{ secrets.NAPCAT_BUILD }}
- 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
2024-04-14 16:52:59 +00:00
release-napcat:
2024-04-14 16:54:02 +00:00
needs: [build-win32,build-linux]
2024-04-14 16:52:59 +00:00
runs-on: ubuntu-latest
steps:
- name: Download Linux Amd64
uses: actions/download-artifact@v2
with:
name: NapCat.linux.amd64
- name: Download Linux Arm64
uses: actions/download-artifact@v2
with:
name: NapCat.linux.arm64
- name: Download Darwin Arm64
uses: actions/download-artifact@v2
with:
name: NapCat.darwin.arm64
- name: Download Darwin Amd64
uses: actions/download-artifact@v2
with:
name: NapCat.darwin.amd64
- name: Download Window Amd.64
uses: actions/download-artifact@v2
with:
name: NapCat.win32.amd64
- name: Create Release Draft and Upload Artifacts
uses: softprops/action-gh-release@v1
with:
files: |
NapCat.win32.amd64.zip
NapCat.linux.amd64.zip
NapCat.linux.arm64.zip
NapCat.darwin.amd64.zip
NapCat.darwin.arm64.zip
draft: true