1.3.5 #29
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: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
permissions: | |
contents: write | |
runs-on: windows-latest | |
steps: | |
- name: Check out git repository | |
uses: actions/checkout@v4 | |
- name: Get package version | |
shell: powershell | |
run: | | |
$version = (Get-Content package.json | ConvertFrom-Json).version | |
echo "PACKAGE_VERSION=$version" >> $env:GITHUB_ENV | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install imageio | |
pip install -r requirements.txt | |
- name: Build | |
uses: Nuitka/[email protected] | |
with: | |
nuitka-version: main | |
script-name: main.py | |
standalone: true | |
onefile: true | |
windows-uac-admin: true | |
windows-icon-from-ico: icon.jpg | |
company-name: ikunshare | |
product-name: Onekey | |
file-version: ${{ env.PACKAGE_VERSION }} | |
product-version: ${{ env.PACKAGE_VERSION }} | |
file-description: 一个Steam仓库清单下载器 | |
copyright: Copyright © 2024 ikun0014 | |
output-file: Onekey---v${{ env.PACKAGE_VERSION }}.exe | |
assume-yes-for-downloads: true | |
output-dir: build | |
- name: Create git tag | |
uses: pkgdeps/git-tag-action@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
github_repo: ${{ github.repository }} | |
version: ${{ env.PACKAGE_VERSION }} | |
git_commit_sha: ${{ github.sha }} | |
git_tag_prefix: "v" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Onekey_v${{ env.PACKAGE_VERSION }}.exe | |
path: build/Onekey_v${{ env.PACKAGE_VERSION }}.exe | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ env.PACKAGE_VERSION }} | |
files: build/Onekey---v${{ env.PACKAGE_VERSION }}.exe | |
prerelease: false | |
draft: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Gitee Release | |
uses: nicennnnnnnlee/[email protected] | |
with: | |
gitee_owner: ikun0014 | |
gitee_repo: Onekey | |
gitee_token: ${{ secrets.GITEE_TOKEN }} | |
gitee_tag_name: v${{ env.PACKAGE_VERSION }} | |
gitee_release_name: v${{ env.PACKAGE_VERSION }} | |
gitee_release_body: I don't know | |
gitee_target_commitish: main | |
gitee_upload_retry_times: 3 | |
gitee_file_name: Onekey---v${{ env.PACKAGE_VERSION }}.exe | |
gitee_file_path: build/Onekey---v${{ env.PACKAGE_VERSION }}.exe | |
- name: Upload to Telegram Channel | |
run: | | |
& curl -F "chat_id=${{ secrets.TELEGRAM_TO }}" ` | |
-F "document=@build/Onekey---v${{ env.PACKAGE_VERSION }}.exe" ` | |
-F "caption=Onekey's New Update ${{ env.PACKAGE_VERSION }}" ` | |
-F "parse_mode=Markdown" ` | |
"https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument" |