Build Postcompiler #211
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 Postcompiler | |
| on: | |
| schedule: | |
| - cron: '14 9 * * TUE' # Run at 9:14 (7:14pm local) on Tuesday | |
| create: | |
| ref_type: 'tag' | |
| workflow_dispatch: | |
| # Allow triggering manually whenever it's useful. | |
| inputs: | |
| ref: | |
| description: 'Branch/tag/commit to use' | |
| required: true | |
| type: string | |
| default: 'dev' | |
| srctools-dev: | |
| description: 'Use the latest commit for srctools' | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| freeze: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # We want 3.8 because it works on Windows 7. | |
| # - artifact-name: 'win32' | |
| # python-version: '3.8.10' | |
| # arch: 'x86' | |
| # os: 'windows-latest' | |
| - artifact-name: 'win64' | |
| python-version: '3.13' | |
| arch: 'x64' | |
| os: 'windows-latest' | |
| - artifact-name: 'linux64' | |
| python-version: '3.13' | |
| arch: 'x64' | |
| os: 'ubuntu-latest' | |
| runs-on: ${{ matrix.os }} | |
| name: Build postcompiler-${{ matrix.artifact-name }} | |
| steps: | |
| # Build dev on schedule, since it's actually changing. | |
| - name: Checkout Dev | |
| uses: actions/checkout@v6 | |
| if: github.event_name == 'schedule' | |
| with: | |
| ref: dev | |
| # Always build the exact tag that's pushed. | |
| - name: Checkout Tag | |
| uses: actions/checkout@v6 | |
| if: github.event_name == 'create' | |
| with: | |
| ref: ${{ github.event.ref }} | |
| - name: Checkout Ref | |
| uses: actions/checkout@v6 | |
| if: github.event_name == 'workflow_dispatch' | |
| with: | |
| ref: ${{ inputs.ref }} | |
| - name: Set up Python ${{ matrix.python-version }}-${{ matrix.arch }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: ${{ matrix.arch }} | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' | |
| - name: Install requirements | |
| run: | | |
| python -m pip install -U setuptools pip wheel | |
| python -m pip install -r requirements.txt | |
| - name: Install dev srctools | |
| if: inputs.srctools-dev | |
| run: | | |
| python -m pip uninstall --yes srctools | |
| python -m pip install srctools@git+https://github.com/TeamSpen210/srctools.git | |
| - name: Freeze application | |
| run: python -m PyInstaller --distpath ../build/ -y ../postcompiler.spec | |
| working-directory: ./src/ | |
| - name: Artifact upload (tag) | |
| uses: actions/upload-artifact@v7 | |
| if: github.event_name == 'create' | |
| with: | |
| name: hammeraddons_${{ github.event.ref }}_${{ matrix.artifact-name }} | |
| path: ./build/ | |
| if-no-files-found: error | |
| - name: Artifact upload (hash) | |
| uses: actions/upload-artifact@v7 | |
| if: github.event_name != 'create' | |
| with: | |
| name: hammeraddons_${{ github.sha }}_${{ matrix.artifact-name }} | |
| path: ./build/ | |
| if-no-files-found: error |