Skip to content

Commit

Permalink
Update macos-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
CookSleep authored Jul 18, 2024
1 parent 8ad9a48 commit 3f2f972
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ name: Build macOS App

on:
release:
types: [published]
types: [created]
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install user dependencies

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install build dependencies
run: |
pip install pyinstaller
- name: Build macOS app
run: |
pyinstaller project_exporter.spec
Expand All @@ -41,10 +42,19 @@ jobs:
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
if: github.event_name == 'release' && github.event.action == 'created'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./项目文件导出工具-macOS.zip
asset_name: 项目文件导出工具-macOS.zip
asset_content_type: application/zip

- name: Upload artifact
uses: actions/upload-artifact@v2
if: github.event_name != 'release'
with:
name: 项目文件导出工具-macOS
path: ./项目文件导出工具-macOS.zip

0 comments on commit 3f2f972

Please sign in to comment.