UI Fixed #114
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: Build OpenPoster | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: main | |
| pull_request: | |
| branches: main | |
| jobs: | |
| lint: | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' || startsWith(github.event.head_commit.message, '[build]') | |
| name: Lint | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: the real deal | |
| run: | | |
| for file in ui/*.ui; do | |
| xmllint --noout "$file" || { | |
| echo "please kindly check $file thank you" | |
| exit 1 | |
| } | |
| done | |
| compile-translations: | |
| needs: [lint] | |
| name: Compile translations | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # trust me bro | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Qt stuff | |
| run: | | |
| sudo apt update | |
| sudo apt-get install -y qttools5-dev-tools | |
| - name: Compile translations | |
| run: | | |
| for ts in languages/*.ts; do | |
| lrelease "$ts" -qm "${ts%.ts}.qm" | |
| done | |
| # - name: Stage and commit translations | |
| # if: false | |
| # run: | | |
| # git config --global user.email "actions@github.com" | |
| # git config --global user.name "GitHub Actions" | |
| # git add languages/*.qm | |
| # git commit -m "ci: update translations" || echo "No changes to commit :3" | |
| # # i'm sorry!! | |
| # if [[ "$GITHUB_ACTOR" != "nektos/act" ]]; then | |
| # git push origin HEAD:main --force | |
| # else | |
| # echo "dry run, not actually pushing ^v^" | |
| # fi | |
| build: | |
| needs: [compile-translations] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - name: macos-intel | |
| os: macos-13 | |
| python: python3 | |
| - name: macos-arm | |
| os: macos-latest | |
| python: python3 | |
| - name: windows | |
| os: windows-latest | |
| python: python | |
| name: Build (${{ matrix.config.name }}) | |
| runs-on: ${{ matrix.config.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| ${{ matrix.config.python }} -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build | |
| run: ${{ matrix.config.python }} compile.py | |
| - name: Zip (Windows) | |
| if: matrix.config.name == 'windows' | |
| run: | | |
| cd dist | |
| if (Test-Path -Path "OpenPoster" -PathType Container) { | |
| Compress-Archive -Path OpenPoster -DestinationPath "OpenPoster-${{ matrix.config.name }}.zip" | |
| } else { | |
| Compress-Archive -Path OpenPoster.exe -DestinationPath "OpenPoster-${{ matrix.config.name }}.zip" | |
| } | |
| - name: Zip (macOS) | |
| if: matrix.config.name != 'windows' | |
| shell: bash | |
| run: | | |
| cd dist | |
| zip -r -y "OpenPoster-${{ matrix.config.name }}.zip" OpenPoster.app | |
| - name: Upload app | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenPoster-${{ matrix.config.name }} | |
| path: dist/OpenPoster-${{ matrix.config.name }}.zip |