NapCatQQ/.github/workflows/release.yml

147 lines
3.9 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
Build-LiteLoader:
needs: [check-version]
runs-on: ubuntu-latest
steps:
- name: Clone Main Repository
uses: actions/checkout@v4
with:
repository: 'NapNeko/NapCatQQ'
submodules: true
ref: main
token: ${{ secrets.NAPCAT_BUILD }}
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
2024-04-16 03:49:44 +00:00
- name: Build NuCat Framework
run: |
npm i
npm run build:framework
cd dist
npm i --omit=dev
cd ..
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NapCat.Framework
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:
needs: [Build-LiteLoader,Build-Shell]
2024-04-14 16:52:59 +00:00
runs-on: ubuntu-latest
steps:
2024-09-23 08:33:02 +00:00
- name: Clone Main Repository
uses: actions/checkout@v4
with:
repository: 'NapNeko/NapCatQQ'
submodules: true
ref: main
token: ${{ secrets.NAPCAT_BUILD }}
2024-09-23 08:39:26 +00:00
2024-09-23 08:35:54 +00:00
- name: Download All Artifact
uses: actions/download-artifact@v4
- name: Compress subdirectories
run: |
cd ./NapCat.Shell/
zip -q -r NapCat.Shell.zip *
cd ..
cd ./NapCat.Framework/
zip -q -r NapCat.Framework.zip *
cd ..
rm ./NapCat.Shell.zip -rf
rm ./NapCat.Framework.zip -rf
mv ./NapCat.Shell/NapCat.Shell.zip ./
mv ./NapCat.Framework/NapCat.Framework.zip ./
2024-09-23 08:52:35 +00:00
2024-09-23 08:33:02 +00:00
mkdir ./NapCat.Framework.Windows.Once
2024-09-23 08:52:35 +00:00
unzip -q ./external/LiteLoaderWrapper.zip -d ./NapCat.Framework.Windows.Once
cd ./NapCat.Framework.Windows.Once
ls
mkdir -p ./LL/plugins/NapCatQQ
unzip -q ../NapCat.Framework.zip -d ./LL/plugins/NapCatQQ
zip -q -r NapCat.Framework.Windows.Once.zip *
cd ..
mv ./NapCat.Framework.Windows.Once/NapCat.Framework.Windows.Once.zip ./
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: |
NapCat.Framework.zip
2024-08-11 17:09:30 +00:00
NapCat.Shell.zip
2024-09-23 08:33:02 +00:00
NapCat.Framework.Windows.Once.zip
2024-04-14 16:52:59 +00:00
draft: true