-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
# schedule: | ||
# - cron: '15 20 * * *' # 每天 20:15 UTC+0 | ||
|
||
jobs: | ||
build-release: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
cache: pip | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pyinstaller==5.8.0 | ||
- name: Build with PyInstaller | ||
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 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$env:PYTHONPATH = "$PWD\src" | ||
|
||
$FileName = "MDCx-$COMMITSHA.exe" | ||
Write-Output "Output File: $FileName" | ||
|
||
python -m PyInstaller -n "$FileName" -F ` | ||
-i resources/Img/MDCx.ico ` | ||
-w main.py ` | ||
-p "./src" ` | ||
--add-data "resources;resources" ` | ||
--add-data "libs;." ` | ||
--hidden-import socks ` | ||
--hidden-import urllib3 ` | ||
--hidden-import _cffi_backend ` | ||
--collect-all curl_cffi | ||
|
||
Write-Output 'Done' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
conda activate mdcx-py | ||
$time = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" | ||
|
||
# 即时构建, 可选后缀 | ||
$suffix = Read-Host -Prompt "Suffix(Optional)" | ||
if ($suffix -ne "") | ||
{ | ||
$suffix = "-$suffix" | ||
} | ||
$FileName = "MDCx-$time$suffix.exe" | ||
|
||
# 正式版 | ||
$release = Read-Host -Prompt "Release version(Optional)" | ||
if ($release -ne "") | ||
{ | ||
$FileName = "MDCx-$release$suffix.exe" | ||
} | ||
|
||
|
||
Write-Output "Output File: $FileName" | ||
|
||
pyi-makespec -n "$FileName" -F ` | ||
-i resources/Img/MDCx.ico ` | ||
-w main.py ` | ||
-p "./src" ` | ||
--add-data "resources;resources" ` | ||
--add-data "libs;." ` | ||
--hidden-import socks ` | ||
--hidden-import urllib3 ` | ||
--hidden-import _cffi_backend ` | ||
--collect-all curl_cffi | ||
|
||
Remove-Item -Recurse -Force dist | ||
|
||
pyinstaller "$FileName.spec" | ||
|
||
Remove-Item -Recurse -Force build | ||
Remove-Item -Force "$FileName.spec" | ||
|
||
Write-Output 'Done' |
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