Skip to content

修改readme

修改readme #1

Workflow file for this run

name: Release on Tag
on:
push:
tags:
- '*' # 监听所有标签的推送事件
jobs:
build-and-release:
runs-on: windows-latest # 使用最新的 Windows 运行器
steps:
# 检出仓库代码
- name: Checkout repository
uses: actions/checkout@v3
# 设置 Python 3.11 环境
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
# 安装依赖和 Nuitka
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python --version
shell: cmd
# 进行编译
- name: Run Compile
run: |
$tag = '${{ github.ref_name }}'
$tag = $tag -replace '[^0-9.]', ''
$parts = $tag.Split('.')
while ($parts.Length -lt 4) {
$parts += '0'
}
$tag = $parts -join '.'
python -m nuitka --windows-file-version=$tag --show-progress --mingw64 --assume-yes-for-downloads --output-dir=out main/Boss-Key.py
# 添加版本信息到可执行文件并重命名
- name: Add version information and rename executable
shell: pwsh
run: |
# 获取标签名作为版本号,去除前缀 refs/tags/
$tag = '${{ github.ref_name }}'
# 定义新的文件名
$newExeName = "Boss-Key-$tag-onefile.exe"
# 重命名可执行文件
Rename-Item "out/Boss-Key.exe" $newExeName
# 压缩out/Boss-Key.dist/文件夹
Compress-Archive -Path "out/Boss-Key.dist" -DestinationPath "out/Boss-Key-$tag-multifile.zip"
ls out
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.ref_name }}-Build
path: |
out/Boss-Key.dist
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
out/Boss-Key-${{ github.ref_name }}-onefile.exe
out/Boss-Key-${{ github.ref_name }}-multifile.zip
token: ${{ secrets.RELEASE }}
name: Boss Key ${{ github.ref_name }}
append_body: |
The executable file for version ${{ github.ref_name }}
make_latest: true
tag_name: ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
compile-to-installer:
runs-on: windows-latest
needs: build-and-release
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Clone Repo
run: |
cd ./.github/inno-script
git clone https://github.com/IvanHanloth/innosetup-action.git
cp -r innosetup-action/* .
dir
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ github.ref_name }}-Build
path: ./.github/inno-script/software
- name: Compile Installer
run: |
dir
.\ISCC.exe /DMyAppVersion='${{ github.ref_name }}' Boss-Key.iss
working-directory: .github/inno-script
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{ github.ref_name }}-Installer
path: .github/inno-script/output/Boss-Key-${{ github.ref_name }}-Installer.exe
- name: Attach Installer to Release
uses: softprops/action-gh-release@v2
with:
files: .github/inno-script/output/Boss-Key-${{ github.ref_name }}-Installer.exe
token: ${{ secrets.RELEASE }}
tag_name: ${{ github.ref_name }}
draft: false
prerelease: false