|
| 1 | +name: PyInstaller Release Builds |
| 2 | + |
| 3 | +on: |
| 4 | + #push: |
| 5 | + # branches: [ main, develop ] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + pyinstaller_build: |
| 10 | + name: Build for ${{ matrix.os }} |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + os: [windows-latest, ubuntu-latest, macos-latest, ubuntu-24.04-arm] |
| 16 | + include: |
| 17 | + - os: windows-latest |
| 18 | + artifact_name: pyocd-windows |
| 19 | + - os: ubuntu-latest |
| 20 | + artifact_name: pyocd-linux |
| 21 | + - os: macos-latest |
| 22 | + artifact_name: pyocd-macos |
| 23 | + - os: ubuntu-24.04-arm |
| 24 | + artifact_name: pyocd-linux-arm64 |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Setup Python |
| 31 | + uses: actions/setup-python@v5 |
| 32 | + with: |
| 33 | + python-version: '3.11' |
| 34 | + cache: 'pip' |
| 35 | + |
| 36 | + - name: Install package |
| 37 | + run: pip install . |
| 38 | + |
| 39 | + - name: Setup build environment |
| 40 | + id: setup |
| 41 | + run: python get_site-packages.py |
| 42 | + |
| 43 | + - name: Verify environment |
| 44 | + run: | |
| 45 | + echo "Site packages: ${{ env.SITE_PACKAGES }}" |
| 46 | + python -c "import sys; print(sys.version)" |
| 47 | +
|
| 48 | + - name: Build with PyInstaller |
| 49 | + run: | |
| 50 | + pip install pyinstaller |
| 51 | + pyinstaller pyocd.spec --log-level=ERROR --clean |
| 52 | +
|
| 53 | + - name: Test binary |
| 54 | + run: ./dist/pyocd/pyocd --help |
| 55 | + if: success() |
| 56 | + - name: Upload artifacts |
| 57 | + uses: actions/upload-artifact@v4 |
| 58 | + if: success() |
| 59 | + with: |
| 60 | + name: pyocd-${{ matrix.os }} |
| 61 | + path: dist/pyocd/* |
| 62 | + retention-days: 7 |
0 commit comments