2603220530: 添加全面的测试套件 #2
Workflow file for this run
This file contains hidden or 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: Release Build | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| shell: pwsh | |
| run: | | |
| python -m venv .venv | |
| ./.venv/Scripts/python -m pip install --upgrade pip | |
| ./.venv/Scripts/python -m pip install -e .[dev] | |
| - name: Build executable | |
| shell: pwsh | |
| run: | | |
| powershell -ExecutionPolicy Bypass -File ./.scripts/build_exe.ps1 | |
| - name: Package release assets | |
| shell: pwsh | |
| run: | | |
| powershell -ExecutionPolicy Bypass -File ./.scripts/package_release.ps1 | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: weekflow-windows-release | |
| path: | | |
| dist/WeekFlow-*.exe | |
| dist/WeekFlow-*.zip | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| python -m venv .venv | |
| ./.venv/bin/python -m pip install --upgrade pip | |
| ./.venv/bin/python -m pip install -e .[dev] | |
| - name: Make release scripts executable | |
| shell: bash | |
| run: | | |
| chmod +x ./.scripts/build_macos_app.sh ./.scripts/package_macos_release.sh | |
| - name: Build macOS app | |
| shell: bash | |
| run: | | |
| ./.scripts/build_macos_app.sh | |
| - name: Package macOS release assets | |
| shell: bash | |
| run: | | |
| ./.scripts/package_macos_release.sh | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: weekflow-macos-release | |
| path: dist/WeekFlow-*.zip | |
| publish-release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-windows | |
| - build-macos | |
| steps: | |
| - name: Download built artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: release-assets | |
| merge-multiple: true | |
| - name: Publish GitHub release assets | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| TAG_NAME: ${{ github.ref_name }} | |
| run: | | |
| ls -la release-assets | |
| gh release view "$TAG_NAME" --repo "$GH_REPO" >/dev/null 2>&1 || gh release create "$TAG_NAME" --repo "$GH_REPO" --title "WeekFlow $TAG_NAME" --generate-notes | |
| gh release upload "$TAG_NAME" release-assets/* --repo "$GH_REPO" --clobber |