CI(package): make build and test matrices match #10
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
| # pyinstaller --console --one-file .\sourcehold\__main__.py | |
| name: Python pyinstaller | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| build_pyinstaller: | |
| permissions: | |
| contents: write | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # os: [ubuntu-latest, windows-latest, macOS-latest] | |
| os: [windows-latest] | |
| platform: [x86] | |
| python-version: ['3.13'] | |
| python-platform: [x86] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: ${{ matrix.python-platform }} | |
| - name: Enable Developer Command Prompt | |
| uses: ilammy/[email protected] | |
| with: | |
| arch: ${{ matrix.python-platform }} | |
| if: matrix.os == 'windows-latest' | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade wheel setuptools Cython | |
| pip install flake8 pytest | |
| pip install -r requirements.txt | |
| - name: Run pyinstaller | |
| shell: bash | |
| run: | | |
| python -m pip install pyinstaller | |
| pyinstaller --console --onefile ./sourcehold/__main__.py --name sourcehold | |
| - name: Ensure special latest release exists | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Set continue on error to true | |
| set +e | |
| if [[ "$(gh --repo sourcehold/sourcehold-maps release view latest 2>&1)" == "release not found" ]]; then | |
| set -e | |
| gh --repo sourcehold/sourcehold-maps release create latest --latest | |
| fi | |
| - name: Upload pyinstaller to special latest release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh --repo sourcehold/sourcehold-maps release upload latest dist/sourcehold* --clobber | |
| - name: Ensure release exists | |
| if: github.ref_type == 'tag' | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Set continue on error to true | |
| set +e | |
| if [[ "$(gh --repo sourcehold/sourcehold-maps release view ${{ github.ref_name }} 2>&1)" == "release not found" ]]; then | |
| set -e | |
| gh --repo sourcehold/sourcehold-maps release create ${{ github.ref_name }} --latest | |
| fi | |
| - name: Upload pyinstaller to release | |
| if: github.ref_type == 'tag' | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh --repo sourcehold/sourcehold-maps release upload ${{ github.ref_name }} dist/sourcehold* |