Skip to content

ci: add pyinstaller workflow #22

ci: add pyinstaller workflow

ci: add pyinstaller workflow #22

name: Generate executable
on:
pull_request:
branches: [ "master" ]
release:
types: [ created ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.12" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U . coloredlogs pyinstaller apple_compress
- name: Build
run: |
python .github/workflows/generate-executable.py
- if: matrix.os == 'ubuntu-latest'
name: Test ubuntu artifact
run: |
./dist/pymobiledevice3
- if: matrix.os == 'macos-latest'
name: Test macos artifact
run: |
./dist/pymobiledevice3
- if: matrix.os == 'windows-latest'
name: Test windows artifact
run: |
./dist/pymobiledevice3.exe
- if: matrix.os == 'ubuntu-latest'
name: Rename ubuntu artifact
run: |
mv ./dist/pymobiledevice3 ./dist/pymobiledevice3_ubuntu
- if: matrix.os == 'macos-latest'
name: Rename macos artifact
run: |
mv ./dist/pymobiledevice3 ./dist/pymobiledevice3_macos
- if: matrix.os == 'ubuntu-latest'
name: Upload ubuntu artifact
uses: actions/upload-artifact@v3
with:
name: pymobiledevice3_ubuntu
path: ./dist/pymobiledevice3_ubuntu
- if: matrix.os == 'macos-latest'
name: Upload macos artifact
uses: actions/upload-artifact@v3
with:
name: pymobiledevice3_macosx
path: ./dist/pymobiledevice3_macos
- if: matrix.os == 'windows-latest'
name: Upload windows artifact
uses: actions/upload-artifact@v3
with:
name: pymobiledevice3_windows.exe
path: ./dist/pymobiledevice3.exe
- name: Upload server artifacts to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
dist/pymobiledevice3_macos
dist/pymobiledevice3_ubuntu
dist/pymobiledevice3.exe
token: ${{ secrets.GITHUB_TOKEN }}