diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index b77028f..4307feb 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -2,7 +2,11 @@ name: Build macOS App on: release: - types: [published] + types: [created] + push: + branches: [ main ] + pull_request: + branches: [ main ] workflow_dispatch: jobs: @@ -10,21 +14,18 @@ jobs: 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 @@ -41,6 +42,7 @@ 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: @@ -48,3 +50,11 @@ jobs: 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 +