From 239151974a60e861f25dad8602af29de73d76cc4 Mon Sep 17 00:00:00 2001 From: Brian Cantoni Date: Fri, 1 Aug 2025 07:22:46 -0700 Subject: [PATCH 1/3] WIP switching to different build container --- .github/workflows/package.yml | 90 +++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index d9b65a93..83d1cdbf 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -15,7 +15,6 @@ on: workflow_dispatch: jobs: - buildexe: name: Build executables and upload them to the existing release runs-on: ${{ matrix.os }} @@ -34,14 +33,11 @@ jobs: TARGET: macos CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ - # the extension .app is not allowed as an upload by github UPLOAD_FILE_NAME: tabcmd-x86.app.tar - # these two names must match the output defined in tabcmd-mac.spec OUT_FILE_NAME: tabcmd.app APP_BINARY_FILE_NAME: tabcmd ASSET_MIME: application/zip - os: macos-latest - # This must match the value set in tabcmd-mac.spec for the output folder TARGET: macos CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ @@ -51,56 +47,66 @@ jobs: ASSET_MIME: application/zip - os: ubuntu-latest TARGET: ubuntu - # https://stackoverflow.com/questions/31259856 - # /how-to-create-an-executable-file-for-linux-machine-using-pyinstaller + CONTAINER: quay.io/centos/centos:stream8 CMD_BUILD: > pyinstaller --clean -y --distpath ./dist/ubuntu tabcmd-linux.spec && chown -R --reference=. ./dist/ubuntu OUT_FILE_NAME: tabcmd UPLOAD_FILE_NAME: tabcmd + container: + image: ${{ matrix.CONTAINER }} + options: --privileged + if: matrix.TARGET == 'ubuntu' + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 - - name: Install dependencies and build - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade build - pip install . - pip install .[package] - doit version - python -m build + - name: Install dependencies and build + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade build + pip install . + pip install .[package] + doit version + python -m build - - name: Package with pyinstaller for ${{matrix.TARGET}} - run: ${{matrix.CMD_BUILD}} + - name: Package with pyinstaller for ${{matrix.TARGET}} + run: ${{matrix.CMD_BUILD}} - - name: Validate package for ${{matrix.TARGET}} - if: matrix.TARGET != 'macos' - run: ./dist/${{ matrix.TARGET }}/${{matrix.OUT_FILE_NAME}} + - name: Verify GLIBC compatibility + if: matrix.TARGET == 'ubuntu' + run: | + cat /etc/os-release + ldd ./dist/ubuntu/tabcmd | grep libc + # Should show GLIBC version 2.28 or lower - - name: Validate package for Mac - if: matrix.TARGET == 'macos' - run: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }}/Contents/MacOS/${{ matrix.APP_BINARY_FILE_NAME }} + - name: Validate package for ${{matrix.TARGET}} + if: matrix.TARGET != 'macos' + run: ./dist/${{ matrix.TARGET }}/${{matrix.OUT_FILE_NAME}} - - name: Tar app bundle for Mac - if: matrix.TARGET == 'macos' - run: | - rm -f dist/${{ matrix.TARGET }}/${{ matrix.APP_BINARY_FILE_NAME }} - cd dist/${{ matrix.TARGET }} - tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }} + - name: Validate package for Mac + if: matrix.TARGET == 'macos' + run: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }}/Contents/MacOS/${{ matrix.APP_BINARY_FILE_NAME }} + - name: Tar app bundle for Mac + if: matrix.TARGET == 'macos' + run: | + rm -f dist/${{ matrix.TARGET }}/${{ matrix.APP_BINARY_FILE_NAME }} + cd dist/${{ matrix.TARGET }} + tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }} - - name: Upload binaries to release for ${{ matrix.TARGET }} - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - asset_name: ${{ matrix.UPLOAD_FILE_NAME }} - file: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }} - tag: ${{ github.ref_name }} - overwrite: true - promote: true + - name: Upload binaries to release for ${{ matrix.TARGET }} + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: ${{ matrix.UPLOAD_FILE_NAME }} + file: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }} + tag: ${{ github.ref_name }} + overwrite: true + promote: true From fe94df24539896829ba4ad43823f8587105ec04f Mon Sep 17 00:00:00 2001 From: Brian Cantoni Date: Wed, 6 Aug 2025 16:52:27 -0700 Subject: [PATCH 2/3] Revert "WIP switching to different build container" This reverts commit 239151974a60e861f25dad8602af29de73d76cc4. --- .github/workflows/package.yml | 90 ++++++++++++++++------------------- 1 file changed, 42 insertions(+), 48 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 83d1cdbf..d9b65a93 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -15,6 +15,7 @@ on: workflow_dispatch: jobs: + buildexe: name: Build executables and upload them to the existing release runs-on: ${{ matrix.os }} @@ -33,11 +34,14 @@ jobs: TARGET: macos CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ + # the extension .app is not allowed as an upload by github UPLOAD_FILE_NAME: tabcmd-x86.app.tar + # these two names must match the output defined in tabcmd-mac.spec OUT_FILE_NAME: tabcmd.app APP_BINARY_FILE_NAME: tabcmd ASSET_MIME: application/zip - os: macos-latest + # This must match the value set in tabcmd-mac.spec for the output folder TARGET: macos CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ @@ -47,66 +51,56 @@ jobs: ASSET_MIME: application/zip - os: ubuntu-latest TARGET: ubuntu - CONTAINER: quay.io/centos/centos:stream8 + # https://stackoverflow.com/questions/31259856 + # /how-to-create-an-executable-file-for-linux-machine-using-pyinstaller CMD_BUILD: > pyinstaller --clean -y --distpath ./dist/ubuntu tabcmd-linux.spec && chown -R --reference=. ./dist/ubuntu OUT_FILE_NAME: tabcmd UPLOAD_FILE_NAME: tabcmd - container: - image: ${{ matrix.CONTAINER }} - options: --privileged - if: matrix.TARGET == 'ubuntu' - steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 - - name: Install dependencies and build - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade build - pip install . - pip install .[package] - doit version - python -m build + - name: Install dependencies and build + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade build + pip install . + pip install .[package] + doit version + python -m build - - name: Package with pyinstaller for ${{matrix.TARGET}} - run: ${{matrix.CMD_BUILD}} + - name: Package with pyinstaller for ${{matrix.TARGET}} + run: ${{matrix.CMD_BUILD}} - - name: Verify GLIBC compatibility - if: matrix.TARGET == 'ubuntu' - run: | - cat /etc/os-release - ldd ./dist/ubuntu/tabcmd | grep libc - # Should show GLIBC version 2.28 or lower + - name: Validate package for ${{matrix.TARGET}} + if: matrix.TARGET != 'macos' + run: ./dist/${{ matrix.TARGET }}/${{matrix.OUT_FILE_NAME}} - - name: Validate package for ${{matrix.TARGET}} - if: matrix.TARGET != 'macos' - run: ./dist/${{ matrix.TARGET }}/${{matrix.OUT_FILE_NAME}} + - name: Validate package for Mac + if: matrix.TARGET == 'macos' + run: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }}/Contents/MacOS/${{ matrix.APP_BINARY_FILE_NAME }} - - name: Validate package for Mac - if: matrix.TARGET == 'macos' - run: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }}/Contents/MacOS/${{ matrix.APP_BINARY_FILE_NAME }} + - name: Tar app bundle for Mac + if: matrix.TARGET == 'macos' + run: | + rm -f dist/${{ matrix.TARGET }}/${{ matrix.APP_BINARY_FILE_NAME }} + cd dist/${{ matrix.TARGET }} + tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }} - - name: Tar app bundle for Mac - if: matrix.TARGET == 'macos' - run: | - rm -f dist/${{ matrix.TARGET }}/${{ matrix.APP_BINARY_FILE_NAME }} - cd dist/${{ matrix.TARGET }} - tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }} - - name: Upload binaries to release for ${{ matrix.TARGET }} - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - asset_name: ${{ matrix.UPLOAD_FILE_NAME }} - file: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }} - tag: ${{ github.ref_name }} - overwrite: true - promote: true + - name: Upload binaries to release for ${{ matrix.TARGET }} + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: ${{ matrix.UPLOAD_FILE_NAME }} + file: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }} + tag: ${{ github.ref_name }} + overwrite: true + promote: true From 78389ceb019367ad931b37827572834827371ecc Mon Sep 17 00:00:00 2001 From: Brian Cantoni Date: Wed, 6 Aug 2025 16:59:10 -0700 Subject: [PATCH 3/3] Switch ubuntu builds to use ubi8/python-312 container instead --- .github/workflows/package.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index d9b65a93..3f77e959 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -19,12 +19,14 @@ jobs: buildexe: name: Build executables and upload them to the existing release runs-on: ${{ matrix.os }} + container: ${{ matrix.CONTAINER }} strategy: fail-fast: false matrix: include: - os: windows-latest TARGET: windows + CONTAINER: '' CMD_BUILD: > pyinstaller tabcmd-windows.spec --clean --noconfirm --distpath ./dist/windows UPLOAD_FILE_NAME: tabcmd.exe @@ -32,6 +34,7 @@ jobs: ASSET_MIME: application/vnd.microsoft.portable-executable - os: macos-13 TARGET: macos + CONTAINER: '' CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ # the extension .app is not allowed as an upload by github @@ -43,6 +46,7 @@ jobs: - os: macos-latest # This must match the value set in tabcmd-mac.spec for the output folder TARGET: macos + CONTAINER: '' CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ UPLOAD_FILE_NAME: tabcmd_arm64.app.tar @@ -51,6 +55,7 @@ jobs: ASSET_MIME: application/zip - os: ubuntu-latest TARGET: ubuntu + CONTAINER: ubi8/python-312 # https://stackoverflow.com/questions/31259856 # /how-to-create-an-executable-file-for-linux-machine-using-pyinstaller CMD_BUILD: >