Try to fix the issues of pyinstaller.spec #63
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: Client Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| branches: | |
| - main | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| include: | |
| - os: ubuntu-latest | |
| artifact_name: pn532_cli_release_linux | |
| - os: windows-latest | |
| artifact_name: pn532_cli_release_windows | |
| - os: macos-latest | |
| artifact_name: pn532_cli_release_macos | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Install MSYS2 toolchain | |
| if: runner.os == 'Windows' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| update: true | |
| install: >- | |
| base-devel | |
| mingw-w64-x86_64-toolchain | |
| path-type: inherit | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r script/requirements.txt | |
| pip install pyinstaller | |
| - name: Build mfkey tools (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| chmod +x script/build_helpers.sh | |
| ./script/build_helpers.sh | |
| - name: Build mfkey tools (Windows) | |
| if: runner.os == 'Windows' | |
| shell: msys2 {0} | |
| env: | |
| CC: gcc | |
| run: | | |
| chmod +x script/build_helpers.sh | |
| ./script/build_helpers.sh | |
| - name: Run PyInstaller | |
| run: | | |
| pyinstaller script/pyinstaller.spec | |
| - name: Bundle mfkey binaries (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| mkdir -p dist/pn532_cli_main/mfkey | |
| cp build/mfkey32v2 build/mfkey64 build/staticnested dist/pn532_cli_main/mfkey/ | |
| - name: Bundle mfkey binaries (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "dist/pn532_cli_main/mfkey" | Out-Null | |
| Copy-Item -Path "build/mfkey32v2","build/mfkey64","build/staticnested" -Destination "dist/pn532_cli_main/mfkey" -Force | |
| - name: Package artifact (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| zip -r "${{ matrix.artifact_name }}.zip" dist/* | |
| - name: Package artifact (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| zip -r "${{ matrix.artifact_name }}.zip" dist/* | |
| - name: Package artifact (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path "dist/*" -DestinationPath "${{ matrix.artifact_name }}.zip" | |
| - name: Upload artifacts (zip only) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_name }}.zip | |
| prerelease: | |
| name: Create prerelease and attach builds | |
| needs: build | |
| if: github.ref == 'refs/heads/dev' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Compute short SHA | |
| id: vars | |
| run: echo "short_sha=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: '*' | |
| merge-multiple: true | |
| path: release-assets | |
| - name: Create GitHub prerelease and upload assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: beta.${{ steps.vars.outputs.short_sha }} | |
| name: PN532 CLI - beta.${{ steps.vars.outputs.short_sha }} | |
| prerelease: true | |
| draft: false | |
| body: | | |
| Auto-generated beta prerelease for commit ${{ github.sha }}. | |
| This release contains PyInstaller builds for Linux, Windows, and macOS. | |
| files: | | |
| release-assets/*.zip |