CI: publish latest release when any platform build succeeds #11
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: Build Installers | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos-dmg: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Prepare virtual environment | |
| run: | | |
| python -m venv .venv | |
| .venv/bin/python -m pip install --upgrade pip | |
| .venv/bin/python -m pip install -r requirements.txt | |
| - name: Ensure launcher executable bit | |
| run: chmod +x "실행.command" "macos/build_installer.command" | |
| - name: Build DMG installer | |
| run: ./macos/build_installer.command | |
| - name: Upload macOS installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TOEFLScorer-macOS-dmg | |
| path: dist_macos/TOEFLScorer-macOS.dmg | |
| build-windows-setup: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Inno Setup | |
| shell: powershell | |
| run: choco install innosetup --no-progress -y | |
| - name: Build Setup.exe | |
| shell: powershell | |
| run: powershell -ExecutionPolicy Bypass -File windows/build_installer.ps1 | |
| - name: Upload Windows installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TOEFLScorer-Windows-Setup | |
| path: dist_windows/installer/TOEFLScorer-Setup.exe | |
| publish-latest-release: | |
| needs: [build-macos-dmg, build-windows-setup] | |
| runs-on: ubuntu-latest | |
| if: ${{ github.ref == 'refs/heads/main' && (needs.build-macos-dmg.result == 'success' || needs.build-windows-setup.result == 'success') }} | |
| steps: | |
| - name: Download macOS artifact | |
| if: needs.build-macos-dmg.result == 'success' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: TOEFLScorer-macOS-dmg | |
| path: release-assets | |
| - name: Download Windows artifact | |
| if: needs.build-windows-setup.result == 'success' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: TOEFLScorer-Windows-Setup | |
| path: release-assets | |
| - name: Publish rolling latest release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: latest | |
| name: Latest Build | |
| body: | | |
| 자동 업데이트 릴리즈입니다. | |
| - macOS DMG | |
| - Windows Setup.exe | |
| prerelease: true | |
| allowUpdates: true | |
| removeArtifacts: true | |
| replacesArtifacts: true | |
| artifacts: "release-assets/*" | |
| token: ${{ secrets.GITHUB_TOKEN }} |