This repository has been archived by the owner on Nov 30, 2024. It is now read-only.
🌟 releases: 发布 v1.0.5 版本 #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 构建发布 | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # 匹配版本标签 | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: "检出代码" | |
uses: actions/checkout@v2 | |
- name: "设置 Python" | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: "安装依赖" | |
run: pip install -r requirements.txt | |
- uses: Nuitka/Nuitka-Action@main | |
name: "构建 Windows 版本" | |
with: | |
script-name: main.py | |
onefile: true | |
enable-plugins: pyside6 | |
disable-console: true | |
windows-icon-from-ico: src/Ui/resource/image/icon.ico | |
output-filename: "NapCat-Desktop" | |
- name: "启用开发者命令提示符" | |
uses: ilammy/msvc-dev-cmd@v1.13.0 | |
- name: "添加清单文件" | |
run: | | |
mt.exe -manifest ./assets/NapCat-Desktop.exe.manifest -outputresource:./build/NapCat-Desktop.exe;1 | |
- name: "上传工件" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: NapCat-Desktop | |
path: ./build/NapCat-Desktop.exe | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: "检出代码" | |
uses: actions/checkout@v2 | |
- name: "下载工件" | |
uses: actions/download-artifact@v3 | |
with: | |
name: NapCat-Desktop | |
- name: "设置标签和 body 内容" | |
id: get_info | |
run: | | |
TAG_NAME=$(echo "${GITHUB_REF#refs/tags/}") | |
BODY=$(cat docs/CHANGELOG.md) | |
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
echo "BODY<<EOF" >> $GITHUB_ENV | |
echo "$BODY" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: "创建发布草案" | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "./NapCat-Desktop.exe" | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ env.TAG_NAME }} | |
name: "NapCat Desktop Release ${{ env.TAG_NAME }}" | |
body: ${{ env.BODY }} |