NapCatQQ/.github/workflows/release.yml

119 lines
3.0 KiB
YAML
Raw Normal View History

2024-06-26 09:16:54 +00:00
name: "Build Release"
2024-04-16 04:41:18 +00:00
2024-04-14 16:09:08 +00:00
on:
push:
tags:
- "v*"
2024-04-16 04:41:18 +00:00
permissions: write-all
2024-04-14 16:09:08 +00:00
jobs:
2024-04-16 04:21:50 +00:00
check-version:
runs-on: ubuntu-latest
steps:
2024-04-16 05:42:22 +00:00
- name: Clone Repository
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
2024-04-16 04:21:50 +00:00
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
2024-04-16 04:41:18 +00:00
2024-04-16 04:21:50 +00:00
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
2024-04-16 05:42:22 +00:00
- name: Check Version
2024-04-16 04:21:50 +00:00
run: |
2024-04-16 05:42:22 +00:00
ls
node ./script/checkVersion.cjs
sh ./checkVersion.sh
2024-08-11 17:13:03 +00:00
Build-LiteLoader:
2024-04-16 04:55:16 +00:00
needs: [check-version]
2024-04-14 16:09:08 +00:00
runs-on: ubuntu-latest
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-15 03:26:11 +00:00
repository: 'NapNeko/NapCatQQ'
2024-04-17 10:40:49 +00:00
submodules: true
2024-04-16 05:49:32 +00:00
ref: main
2024-05-09 10:46:32 +00:00
token: ${{ secrets.NAPCAT_BUILD }}
2024-04-14 16:22:46 +00:00
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
2024-04-16 03:49:44 +00:00
node-version: 20.x
2024-08-11 17:17:47 +00:00
- name: Build NuCat Framework
2024-04-14 16:22:46 +00:00
run: |
2024-08-11 17:09:30 +00:00
npm i
2024-08-11 17:17:47 +00:00
npm run build:framework
2024-04-14 16:22:46 +00:00
cd dist
2024-08-11 17:09:30 +00:00
npm i --omit=dev
2024-04-14 16:22:46 +00:00
cd ..
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
2024-08-11 17:17:47 +00:00
name: NapCat.Framework
2024-04-14 16:22:46 +00:00
path: dist
2024-08-11 17:13:03 +00:00
Build-Shell:
2024-04-14 16:22:46 +00:00
runs-on: ubuntu-latest
2024-04-16 04:55:16 +00:00
needs: [check-version]
2024-04-14 16:22:46 +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-14 16:22:46 +00:00
submodules: true
2024-04-16 05:49:32 +00:00
ref: main
2024-05-09 10:46:32 +00:00
token: ${{ secrets.NAPCAT_BUILD }}
2024-04-16 04:21:50 +00:00
2024-04-14 16:22:46 +00:00
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
2024-04-16 03:49:44 +00:00
2024-08-11 17:13:03 +00:00
- name: Build NuCat Shell
2024-04-14 16:22:46 +00:00
run: |
2024-08-11 17:09:30 +00:00
npm i
2024-08-12 06:20:27 +00:00
npm run build:shell
2024-04-14 16:22:46 +00:00
cd dist
2024-08-11 17:09:30 +00:00
npm i --omit=dev
2024-04-14 16:22:46 +00:00
cd ..
2024-04-16 04:21:50 +00:00
2024-04-14 16:22:46 +00:00
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
2024-08-11 17:09:30 +00:00
name: NapCat.Shell
2024-04-14 16:22:46 +00:00
path: dist
2024-04-16 04:21:50 +00:00
2024-04-14 16:52:59 +00:00
release-napcat:
2024-08-11 17:13:03 +00:00
needs: [Build-LiteLoader,Build-Shell]
2024-04-14 16:52:59 +00:00
runs-on: ubuntu-latest
steps:
2024-04-14 17:01:36 +00:00
- name: Download All Artifact
uses: actions/download-artifact@v4
2024-04-14 17:11:29 +00:00
- name: Compress subdirectories
run: |
2024-08-15 08:51:31 +00:00
zip -q -r NapCat.Shell.zip ./NapCat.Shell/*
zip -q -r NapCat.Framework.zip ./NapCat.Framework/*
2024-04-16 05:53:14 +00:00
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
2024-05-03 12:34:32 +00:00
2024-05-03 12:44:04 +00:00
- name: Clone Changes Log
2024-05-18 10:18:08 +00:00
run: curl -o CHANGELOG.md https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/docs/changelogs/CHANGELOG.v${{ env.VERSION }}.md
2024-05-03 12:34:32 +00:00
2024-04-14 16:52:59 +00:00
- name: Create Release Draft and Upload Artifacts
uses: softprops/action-gh-release@v1
with:
2024-04-16 06:01:05 +00:00
name: NapCat V${{ env.VERSION }}
2024-04-17 10:27:08 +00:00
token: ${{ secrets.GITHUB_TOKEN }}
2024-04-26 10:46:12 +00:00
body_path: CHANGELOG.md
2024-04-14 16:52:59 +00:00
files: |
2024-08-11 17:17:47 +00:00
NapCat.Framework.zip
2024-08-11 17:09:30 +00:00
NapCat.Shell.zip
2024-04-14 16:52:59 +00:00
draft: true