Skip to content

测试工作流

测试工作流 #23

permissions:
contents: write # 打开写入权限
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
# 从该tag打上一个release标签
- name: Set Tag
id: set-tag
run: |
CURRENT_DATE=(date +"%Y%m%d")
echo "::set-output name=CURRENT_TAG::CURRENT_DATE"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.set-tag.outputs.CURRENT_TAG }} # tag号
release_name: infinity # 本次发布名称
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.exe
asset_name: infinity.exe
asset_content_type: application/x-msdownload