From b7e584b238cff5db7eacb4caf77a846f228224b3 Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Sat, 16 Nov 2024 11:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 59 +++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 222220d..6c46d8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,17 +34,37 @@ jobs: pip install -r requirements.txt 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-disable-console --onefile --standalone --follow-import-to=core --windows-icon-from-ico=icon.ico --windows-file-version=$tag --windows-product-name="Boss Key" --windows-file-description="Boss Key Application" --include-data-file=icon.ico=. --windows-company-name="Ivan Hanloth" --show-progress --mingw64 --copyright="Copyright (C) 2024 Ivan Hanloth All Rights Reserved. " --quiet --assume-yes-for-downloads --output-dir=out Boss-Key.py + # # 进行编译 + # - 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-disable-console --onefile --standalone --follow-import-to=core --windows-icon-from-ico=icon.ico --windows-file-version=$tag --windows-product-name="Boss Key" --windows-file-description="Boss Key Application" --include-data-file=icon.ico=. --windows-company-name="Ivan Hanloth" --show-progress --mingw64 --copyright="Copyright (C) 2024 Ivan Hanloth All Rights Reserved. " --quiet --assume-yes-for-downloads --output-dir=out Boss-Key.py + + # Build python script into a stand-alone exe + - uses: Nuitka/Nuitka-Action@main + with: + nuitka-version: main + script-name: Boss-Key.py + output-dir: out + windows-disable-console: true + windows-icon-from-ico: icon.ico + windows-file-version: ${{ github.ref_name }} + windows-product-name: "Boss Key" + windows-file-description: "Boss Key Application" + windows-company-name: "Ivan Hanloth" + include-data-file: icon.ico=. + show-progress: true + mingw64: true + quiet: true + assume-yes-for-downloads: true + + # 添加版本信息到可执行文件并重命名 - name: Add version information and rename executable @@ -60,7 +80,13 @@ jobs: Rename-Item "out/Boss-Key.exe" $newExeName ls out - + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ github.ref_name }} Build + path: | + out/Boss-Key.exe + # 发布到 GitHub Releases # - name: Create GitHub Release # uses: ncipollo/release-action@v1 @@ -75,10 +101,11 @@ jobs: uses: softprops/action-gh-release@v2 with: files: out/Boss-Key-${{ github.ref_name }}.exe - token: ${{ secrets.GITHUB_TOKEN }} - release_name: Release $tag - body: | - This is a release for version $tag + 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 \ No newline at end of file