Build executables #2
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 executables | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| artifact_name: FSS-Navigator-macOS | |
| - os: windows-latest | |
| artifact_name: FSS-Navigator-Windows | |
| - os: ubuntu-latest | |
| artifact_name: FSS-Navigator-Linux | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Miniconda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: fssnav | |
| environment-file: environment-ci.yml | |
| auto-activate: false | |
| use-mamba: true | |
| - name: Run tests | |
| shell: bash -l {0} | |
| run: | | |
| conda activate fssnav | |
| pytest Computations/Code/tests | |
| - name: Build executable | |
| shell: bash -l {0} | |
| run: | | |
| conda activate fssnav | |
| pyinstaller --name FSS-Navigator --onedir run_app.py | |
| - name: Copy app files into bundle | |
| shell: bash -l {0} | |
| run: | | |
| cp -R Computations dist/FSS-Navigator/ | |
| cp README.md dist/FSS-Navigator/ | |
| cp requirements.txt dist/FSS-Navigator/ | |
| - name: Zip bundle on macOS/Linux | |
| if: runner.os != 'Windows' | |
| shell: bash -l {0} | |
| run: | | |
| cd dist | |
| zip -r ${{ matrix.artifact_name }}.zip FSS-Navigator | |
| - name: Zip bundle on Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path dist/FSS-Navigator -DestinationPath dist/${{ matrix.artifact_name }}.zip | |
| - name: Upload executable artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: dist/${{ matrix.artifact_name }}.zip |