Skip to content

Commit

Permalink
CI: auto build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
sqzw-x committed Jan 14, 2024
1 parent fd2a4be commit f7fc1c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Build Release Windows

on:
push:
branches:
- master
# schedule:
# - cron: '15 20 * * *' # 每天 20:15 UTC+0
release:
types: [ published ]

jobs:
build-release:
Expand All @@ -25,13 +24,13 @@ jobs:
pip install pyinstaller==5.8.0
- name: Build with PyInstaller
id: build
run: |
$COMMITSHA = "${{ github.sha }}".Substring(0, 7)
./build-action
- name: Create Release
uses: Shopify/upload-to-release@v2.0.0
with:
name: ${{ github.sha }}
path: dist/MDCx-$COMMITSHA.exe
name: MDCx-windows-x86_64.exe
path: dist/MDCx-windows-x86_64.exe
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion build-action.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$env:PYTHONPATH = "$PWD\src"

$FileName = "MDCx-$COMMITSHA.exe"
$FileName = "MDCx-windows-x86_64.exe"
Write-Output "Output File: $FileName"

python -m PyInstaller -n "$FileName" -F `
Expand Down
2 changes: 1 addition & 1 deletion src/models/base/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def check_version():
_, res_json = get_html(url, json_data=True)
if isinstance(res_json, dict):
try:
latest_version = res_json['assets'][0]['name'].replace('MDCx-', '').replace('.exe', '')
latest_version = res_json['tag_name']
latest_version = int(latest_version)
return latest_version
except:
Expand Down

0 comments on commit f7fc1c6

Please sign in to comment.