summaryrefslogtreecommitdiff
path: root/.github/workflows/pyinstaller-release.yaml
blob: 44e27162a6a7815551810761ccb37cb89d9cd5b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build Release

on:
  release:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        arch: [x64, arm64]
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install Webpack dependencies
        working-directory: ./static
        run: npm install

      - name: Run Webpack
        working-directory: ./static
        run: npx webpack

      - name: Set up QEMU for cross-architecture
        if: matrix.arch == 'arm64'
        uses: docker/setup-qemu-action@v3
        with:
          platforms: arm64

#      - name: Run pyinstaller
#        uses: sayyid5416/pyinstaller@v1
#        with:
#          python_arch: ${{ matrix.arch }}
#          spec: 'pix.spec'
#          requirements: 'requirements.txt'
#          #upload_exe_with_name: 'pix'
#          options: --onefile

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'

      - name: Install Python dependencies
        run: |
          python -m pip install --upgrade pip
          pip install pyinstaller
          pip install -r requirements.txt

      - name: Install system dependencies for arm64
        if: matrix.arch == 'arm64'
        run: |
          sudo apt-get update
          sudo apt-get install -y zlib1g-dev libffi-dev libssl-dev

      - name: Run PyInstaller
        env:
          TARGET_ARCH: ${{ matrix.arch }}
        run: |
          if [ "${{ matrix.arch }}" = "arm64" ]; then
            pyinstaller --onefile --target-arch aarch64 pix.py
          else
            pyinstaller --onefile pix.py
          fi

      - name: Upload executable
        uses: actions/upload-artifact@v4
        with:
          name: pixpy-${{ matrix.arch }}
          path: dist/pix