|
| 1 | +name: Simple Package — Sequential macOS arm64 & Windows x64 |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: # manual trigger |
| 5 | + push: |
| 6 | + tags: ["v*"] |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-macos-arm64: |
| 10 | + name: Build macOS arm64 |
| 11 | + runs-on: macos-latest |
| 12 | + steps: |
| 13 | + - name: Check out |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Show runner arch |
| 17 | + run: uname -m || true |
| 18 | + - name: Setup Python |
| 19 | + uses: actions/setup-python@v4 |
| 20 | + with: |
| 21 | + python-version: "3.11" |
| 22 | + |
| 23 | + # Exercise 1: Implement dependency installation here |
| 24 | + - name: Install deps |
| 25 | + run: | |
| 26 | + python -m pip install --upgrade pip |
| 27 | + echo "TODO: Achieve pip requirements installation over here" |
| 28 | +
|
| 29 | + # Remember to add a -n parameter to name the output binary appropriately for each platform |
| 30 | + - name: Build with PyInstaller (macOS arm64) |
| 31 | + run: | |
| 32 | + pyinstaller --onefile app/hello.py -n hello-macos-arm64 |
| 33 | + - name: Debug dist |
| 34 | + run: ls -la dist || true |
| 35 | + - name: Upload macOS artifact |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: hello-macos-arm64 |
| 39 | + path: dist/hello-macos-arm64 |
| 40 | + |
| 41 | + build-windows-x64: |
| 42 | + name: Build Windows x64 |
| 43 | + runs-on: windows-latest |
| 44 | + steps: |
| 45 | + - name: Check out |
| 46 | + uses: actions/checkout@v4 |
| 47 | + - name: Setup Python |
| 48 | + uses: actions/setup-python@v4 |
| 49 | + with: |
| 50 | + python-version: "3.11" |
| 51 | + |
| 52 | + - name: Install deps |
| 53 | + run: | |
| 54 | + python -m pip install --upgrade pip |
| 55 | + pip install -r requirements.txt |
| 56 | + |
| 57 | + # Exercise 2: Implement Windows build steps here |
| 58 | + # You can refer to the macOS build steps above for guidance |
| 59 | + # - name: Build with PyInstaller (Windows x64) |
| 60 | + # ... |
| 61 | + |
| 62 | + - name: Debug dist |
| 63 | + shell: pwsh |
| 64 | + run: dir dist || true |
| 65 | + |
| 66 | + # Exercise 3: Implement artifact upload here |
| 67 | + # - name: Upload Windows artifact |
| 68 | + # uses: actions/upload-artifact@v4 |
| 69 | + # with: |
| 70 | + # name: hello-windows-x64.exe |
| 71 | + # path: # TODO: Specify the path to the Windows build artifact here, it is a file with .exe extension |
0 commit comments