Major refactor #66
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 Workflow | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| build_matrix: | |
| strategy: | |
| matrix: | |
| os: [windows-latest, macos-15-intel] | |
| if: github.event.pull_request.merged == true | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Python (MacOS) | |
| if: ${{ matrix.os == 'macos-15-intel' }} | |
| run: | | |
| wget https://www.python.org/ftp/python/3.10.6/python-3.10.6-macos11.pkg | |
| sudo installer -verbose -pkg ./python-3.10.6-macos11.pkg -target / | |
| echo "/Library/Frameworks/Python.framework/Versions/3.10/bin" >> $GITHUB_PATH | |
| - name: Install Python (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.10' | |
| architecture: 'x64' | |
| - name: Install Requirements (MacOS) | |
| if: ${{ matrix.os == 'macos-15-intel' }} | |
| run: | | |
| pip3 install -r requirements.txt | |
| - name: Install Requirements (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Run PyInstaller (MacOS) | |
| if: ${{ matrix.os == 'macos-15-intel' }} | |
| run: | | |
| pyinstaller PySN.py -w --onefile | |
| - name: Run PyInstaller (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: | | |
| pyinstaller PySN.py -w --add-data "AphIcon.ico;." --icon="AphIcon.ico" | |
| - name: Move and Zip (MacOS) | |
| if: ${{ matrix.os == 'macos-15-intel' }} | |
| run: | | |
| mkdir macos | |
| cp dist/PySN macos | |
| (cd macos/ && zip -r -X ../PySN_MacOS.zip .) | |
| - name: Move and Zip (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| run: | | |
| mkdir windows | |
| cp -r dist/* windows | |
| Compress-Archive -Path "windows/*" -DestinationPath PySN_Windows.zip | |
| - name: Upload Artifact (MacOS) | |
| if: ${{ matrix.os == 'macos-15-intel' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PySN_MacOS.zip | |
| path: PySN_MacOS.zip | |
| - name: Upload Artifact (Windows) | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PySN_Windows.zip | |
| path: PySN_Windows.zip | |
| create_release: | |
| needs: build_matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: PySN_MacOS.zip | |
| path: ./artifacts | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: PySN_Windows.zip | |
| path: ./artifacts | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v2.5.0 | |
| release_name: v2.5.0 | |
| body: | | |
| Largest refactor of PySN to date. | |
| - Major speed improvements, particularly when searching for firmware or parsing games.yml. | |
| - Fetch FW locales concurrently. | |
| - Parse games.yml concurrently (results in updates being listed out of order, but is ~10x faster). | |
| - Use session objects and connection pooling for all requests. | |
| - Massive cleanup to codebase. | |
| - Removed redundant requests and function calls. | |
| - Reorganized code into more logical classes and functions. | |
| - Perform tasks on the proper threads. | |
| - Reduce UI spam during downloads. | |
| - Handle some invisible errors when downloading all from games.yml or searching while still downloading. | |
| - Limit simultaneous downloads to 12 to prevent thrashing drives. I'm happy to increase this if requested. | |
| draft: false | |
| prerelease: false | |
| - name: Upload Release Asset (Windows) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./artifacts/PySN_Windows.zip | |
| asset_name: PySN_Windows.zip | |
| asset_content_type: application/zip | |
| - name: Upload Release Asset (MacOS) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./artifacts/PySN_MacOS.zip | |
| asset_name: PySN_MacOS.zip | |
| asset_content_type: application/zip |