工作流测试 #7
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: Python package | |
on: | |
push: # 推送时触发工作流 | |
branches: [ "main" ] | |
# 具体任务 | |
jobs: | |
build: # 任务名称 | |
name: start build # 工作名称 | |
runs-on: windows-latest # 系统镜像 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11"] # 指定python版本 | |
steps: # 具体步骤 | |
# ---------安装依赖------------ | |
- uses: actions/checkout@v3 # 进入该项目目录 | |
- name: Set up Python ${{ matrix.python-version }} # 步骤名 | |
uses: actions/setup-python@v3 # 安装python | |
with: # 完成后执行 | |
python-version: ${{ matrix.python-version }} # 查看python版本 | |
- name: Install dependencies # 步骤名 | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
# ------------配置Dependency Walker------------ | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Create directories | |
run: | | |
New-Item -ItemType Directory -Force -Path "C:\Users\runneradmin\AppData\Local\Nuitka\Nuitka\Cache\downloads\depends\x86_64" | |
- name: Download Dependency Walker | |
run: | | |
Invoke-WebRequest -Uri "https://dependencywalker.com/depends22_x64.zip" -OutFile "temp_depends.zip" | |
- name: Create temp directory | |
run: | | |
New-Item -ItemType Directory -Force -Path temp/depends | |
- name: Move downloaded file | |
run: | | |
Move-Item -Path temp_depends.zip -Destination temp/depends/depends22_x64.zip | |
- name: Extract Dependency Walker | |
run: | | |
Expand-Archive -Path temp/depends/depends22_x64.zip -DestinationPath C:\Users\runneradmin\AppData\Local\Nuitka\Nuitka\Cache\downloads\depends\x86_64 | |
# ------------打包应用------------ | |
# - name: Deploy infinity # 步骤名 | |
# run: | | |
# pyside6-deploy -f main.py | |
# 上传 EXE 文件作为 GitHub 发布资产 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./main.py | |
asset_name: infinity.exe | |
asset_content_type: application/x-msdownload |