Build Scrutiny App #68
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 Scrutiny App | |
| on: | |
| workflow_dispatch : | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-user-guide: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| # Check-out repository | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| # Setup Python | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| # Fetch all the build dependencies | |
| - name: Install dependencies | |
| run: pip install -e .[doc] | |
| # Latex packages | |
| - name: Install Latex tools | |
| run: | | |
| sudo apt-get update \ | |
| && sudo apt-get install -y \ | |
| latexmk texlive-latex-base \ | |
| texlive-latex-extra \ | |
| texlive-latex-recommended | |
| shell: bash | |
| # Build the user guide and give it to the scrutiny package. Enables ``scrutiny userguide`` command | |
| - name: Build user guide | |
| run: ./scripts/build_userguide.sh | |
| shell: bash | |
| # Request Scrutiny to give us the exact name of the .pdf file | |
| - name: Get user guide path | |
| run: echo "USER_GUIDE_LOCATION=$(python -m scrutiny userguide location)" >> $GITHUB_ENV | |
| shell: bash | |
| # Upload the .pdf | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: user_guide_${{ github.ref_name }} | |
| path: ${{ env.USER_GUIDE_LOCATION }} | |
| if-no-files-found: error | |
| build-ubuntu: | |
| needs: build-user-guide | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| # Check-out repository | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| # Download the user guide from previous job | |
| - name: Download User Guide | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: user_guide_${{ github.ref_name }} | |
| path: ./scrutiny/ | |
| # Setup Python | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| # Fetch all the build dependencies | |
| - name: Install dependencies | |
| run: pip install -e .[build] | |
| # Launch Nuitka | |
| - name: Nuitka build | |
| env: | |
| SCRUTINY_USER_GUIDE_PREBUILT: 1 # Prevent trying to rebuild the user guide. | |
| run: ./scripts/nuitka_build.sh | |
| shell: bash | |
| # Create a Debian package | |
| - name: Create package | |
| run: ./scripts/make_debian_package.sh | |
| shell: bash | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Debian package ${{ github.ref_name }} | |
| path: ./nuitka_build/installer/*.deb | |
| if-no-files-found: error | |
| build-mac-os: | |
| needs: build-user-guide | |
| runs-on: macos-latest | |
| steps: | |
| # Check-out repository | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| # Download the user guide from previous job | |
| - name: Download User Guide | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: user_guide_${{ github.ref_name }} | |
| path: ./scrutiny/ | |
| # Setup Python | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| # Fetch all the build dependencies | |
| - name: Install dependencies | |
| run: pip install -e .[build] | |
| # Launch Nuitka | |
| - name: Nuitka build | |
| env: | |
| SCRUTINY_USER_GUIDE_PREBUILT: 1 # Prevent trying to rebuild the user guide. | |
| run: ./scripts/nuitka_build.sh | |
| shell: bash | |
| # Create a DMG file | |
| - name: Create package | |
| run: ./scripts/make_macos_dmg.sh | |
| shell: bash | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Mac OS app ${{ github.ref_name }} | |
| path: ./nuitka_build/installer/*.dmg | |
| if-no-files-found: error | |
| build-windows: | |
| needs: build-user-guide | |
| runs-on: windows-latest | |
| steps: | |
| # Check-out repository | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| # Download the user guide from previous job | |
| - name: Download User Guide | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: user_guide_${{ github.ref_name }} | |
| path: ./scrutiny/ | |
| # Setup Python | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| # Fetch all the build dependencies | |
| - name: Install dependencies | |
| run: pip install -e .[build] | |
| # Launch Nuitka | |
| - name: Nuitka build | |
| env: | |
| SCRUTINY_USER_GUIDE_PREBUILT: 1 # Prevent trying to rebuild the user guide. | |
| run: ./scripts/nuitka_build.sh | |
| shell: bash | |
| # Sign scrutiny.exe | |
| - name: Sign Executable | |
| run: ./scripts/sign_pe32.sh | |
| "${{ secrets.CODESIGN_ENDPOINT }}" | |
| "${{ secrets.CODESIGN_AUTH_TOKEN }}" | |
| "./nuitka_build/scrutiny.dist/scrutiny.exe" | |
| "./nuitka_build/scrutiny.dist/scrutiny.exe" | |
| shell: bash | |
| # Launch InnoSetup | |
| - name: InnoSetup packaging | |
| run: ./scripts/make_windows_installer.sh | |
| shell: bash | |
| # Get the name of the installer generated by make_windows_installer.sh | |
| - name: Get Installer Name | |
| run: echo "INSTALLER_NAME=$(./scripts/make_windows_installer_name.sh)" >> $GITHUB_ENV | |
| shell: bash | |
| # Sign the installer | |
| - name: Sign Installer | |
| run: ./scripts/sign_pe32.sh | |
| "${{ secrets.CODESIGN_ENDPOINT }}" | |
| "${{ secrets.CODESIGN_AUTH_TOKEN }}" | |
| "./nuitka_build/installer/${{ env.INSTALLER_NAME }}.exe" | |
| "./nuitka_build/installer/${{ env.INSTALLER_NAME }}.exe" | |
| shell: bash | |
| # Upload to github | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Windows installer ${{ github.ref_name }} | |
| path: ./nuitka_build/installer/${{ env.INSTALLER_NAME }}.exe | |
| if-no-files-found: error |