From 147cad5ab41e1af68ce91dc11d1687dac4afb047 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:12:52 +0530 Subject: [PATCH 01/18] try adding support for linux arm binaries --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c08237..f4dd5a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: - { name: "Linux-x86_64", target: x86_64-linux, os: ubuntu-20.04 } # No arm linux OS available on github actions. # Find another way. - # - { name: "Linux-aarch64", target: aarch64-linux, os: ubuntu-latest } + - { name: "Linux-aarch64", target: aarch64-linux, os: ubuntu-20.04 } - { name: "macOS-x86_64", target: x86_64-darwin, os: macOS-13 } - { name: "macOS-aarch64", target: aarch64-darwin, os: macOS-14 } # - { @@ -46,6 +46,17 @@ jobs: unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT + - uses: uraimo/run-on-arch-action@v2 + if: ${{ matrix.name }} == "Linux-aarch64" + name: Setup qemu to build for unavailable platform + id: runcmd + with: + arch: aarch64 + distro: ${{ matrix.os }} + # Not required, but speeds up builds by storing container images in + # a GitHub package registry. + githubToken: ${{ github.token }} + - uses: actions/setup-python@v5 with: python-version: "3.12" From 46f68da6c6ef880b49c426cf241939bdc1ab629e Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:14:38 +0530 Subject: [PATCH 02/18] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4dd5a4..41e9cb5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: id: runcmd with: arch: aarch64 - distro: ${{ matrix.os }} + distro: ubuntu20.04 # Not required, but speeds up builds by storing container images in # a GitHub package registry. githubToken: ${{ github.token }} From 7134acc18607822b4af6249d7b4e015dbe87b352 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:15:08 +0530 Subject: [PATCH 03/18] something else --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41e9cb5..dfdec27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT - uses: uraimo/run-on-arch-action@v2 - if: ${{ matrix.name }} == "Linux-aarch64" + if: matrix.name == "Linux-aarch64" name: Setup qemu to build for unavailable platform id: runcmd with: From 0e79ac3973d096e41c4e13aac9a048075a45ba50 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:18:41 +0530 Subject: [PATCH 04/18] even better quotes --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfdec27..0e8add9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT - uses: uraimo/run-on-arch-action@v2 - if: matrix.name == "Linux-aarch64" + if: matrix.name == 'Linux-aarch64' name: Setup qemu to build for unavailable platform id: runcmd with: From f4e30ee59da962dc1fe1bb9b2c494b34be5c9fc8 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:32:47 +0530 Subject: [PATCH 05/18] change of plans --- .github/workflows/build-cross.yml | 137 ++++++++++++++++++++++++++++++ .github/workflows/build.yml | 14 --- 2 files changed, 137 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/build-cross.yml diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml new file mode 100644 index 0000000..6ee65f5 --- /dev/null +++ b/.github/workflows/build-cross.yml @@ -0,0 +1,137 @@ +name: Build binaries for all platforms + +on: + push: + tags: + - "v*" + branches: + - main + workflow_dispatch: + pull_request: + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - { name: "Linux-aarch64", target: aarch64-linux, os: ubuntu-20.04 } + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Check for release + id: is-release + shell: bash + run: | + unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi + echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install packaged + run: | + pip install . + + - uses: uraimo/run-on-arch-action@v2 + name: Build binary under QEMU + id: build + with: + arch: aarch64 + distro: ubuntu20.04 + # Not required, but speeds up builds by storing container images in + # a GitHub package registry. + githubToken: ${{ github.token }} + run: | + # aliens: requires no source + ALIENS_NAME="aliens-${{ matrix.target }}.bin" + ALIENS_PATH=${PWD}/${ALIENS_NAME} + packaged $ALIENS_NAME 'pip install pygame' 'python -m pygame.examples.aliens' + + # textual: requires no source + TEXTUAL_NAME="textual-${{ matrix.target }}.bin" + TEXTUAL_PATH=${PWD}/${TEXTUAL_NAME} + packaged $TEXTUAL_NAME 'pip install pygame' 'python -m textual' + + # IPython: requires no source + IPYTHON_NAME="ipython-${{ matrix.target }}.bin" + IPYTHON_PATH=${PWD}/${IPYTHON_NAME} + packaged $IPYTHON_NAME 'pip install ipython' 'ipython' + + # ./examples/mandelbrot + MANDELBROT_NAME="mandelbrot-${{ matrix.target }}.bin" + MANDELBROT_PATH=${PWD}/${MANDELBROT_NAME} + packaged $MANDELBROT_NAME 'pip install -r requirements.txt' 'python mandelbrot.py' ./example/mandelbrot + + # ./examples/minesweeper + MINESWEEPER_NAME="minesweeper-${{ matrix.target }}.bin" + MINESWEEPER_PATH=${PWD}/${MINESWEEPER_NAME} + packaged ./example/minesweeper + mv ./minesweeper.bin $MINESWEEPER_NAME + + # Setup output paths for upload + echo "ALIENS_NAME=${ALIENS_NAME}" >> $GITHUB_OUTPUT + echo "ALIENS_PATH=${ALIENS_PATH}" >> $GITHUB_OUTPUT + echo "TEXTUAL_NAME=${TEXTUAL_NAME}" >> $GITHUB_OUTPUT + echo "TEXTUAL_PATH=${TEXTUAL_PATH}" >> $GITHUB_OUTPUT + echo "IPYTHON_NAME=${IPYTHON_NAME}" >> $GITHUB_OUTPUT + echo "IPYTHON_PATH=${IPYTHON_PATH}" >> $GITHUB_OUTPUT + echo "MANDELBROT_NAME=${MANDELBROT_NAME}" >> $GITHUB_OUTPUT + echo "MANDELBROT_PATH=${MANDELBROT_PATH}" >> $GITHUB_OUTPUT + echo "MINESWEEPER_NAME=${MINESWEEPER_NAME}" >> $GITHUB_OUTPUT + echo "MINESWEEPER_PATH=${MINESWEEPER_PATH}" >> $GITHUB_OUTPUT + + - name: Upload aliens + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.ALIENS_NAME }} + path: ${{ steps.build.outputs.ALIENS_PATH }} + + - name: Upload textual + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.TEXTUAL_NAME }} + path: ${{ steps.build.outputs.TEXTUAL_PATH }} + + - name: Upload IPython + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.IPYTHON_NAME }} + path: ${{ steps.build.outputs.IPYTHON_PATH }} + + - name: Upload mandelbrot + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.MANDELBROT_NAME }} + path: ${{ steps.build.outputs.MANDELBROT_PATH }} + + - name: Upload minesweeper + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.MINESWEEPER_NAME }} + path: ${{ steps.build.outputs.MINESWEEPER_PATH }} + + - name: Publish packages + uses: softprops/action-gh-release@v1 + if: steps.is-release.outputs.IS_RELEASE + with: + draft: true + files: | + ${{ steps.build.outputs.ALIENS_PATH }} + ${{ steps.build.outputs.TEXTUAL_PATH }} + ${{ steps.build.outputs.IPYTHON_PATH }} + ${{ steps.build.outputs.MANDELBROT_PATH }} + ${{ steps.build.outputs.MINESWEEPER_PATH }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e8add9..8ae1b5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,9 +25,6 @@ jobs: matrix: include: - { name: "Linux-x86_64", target: x86_64-linux, os: ubuntu-20.04 } - # No arm linux OS available on github actions. - # Find another way. - - { name: "Linux-aarch64", target: aarch64-linux, os: ubuntu-20.04 } - { name: "macOS-x86_64", target: x86_64-darwin, os: macOS-13 } - { name: "macOS-aarch64", target: aarch64-darwin, os: macOS-14 } # - { @@ -46,17 +43,6 @@ jobs: unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT - - uses: uraimo/run-on-arch-action@v2 - if: matrix.name == 'Linux-aarch64' - name: Setup qemu to build for unavailable platform - id: runcmd - with: - arch: aarch64 - distro: ubuntu20.04 - # Not required, but speeds up builds by storing container images in - # a GitHub package registry. - githubToken: ${{ github.token }} - - uses: actions/setup-python@v5 with: python-version: "3.12" From fd91914a20926dec108220ada1ef90aa97164c22 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:35:05 +0530 Subject: [PATCH 06/18] more setup --- .github/workflows/build-cross.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 6ee65f5..b073b90 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -36,24 +36,19 @@ jobs: unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install packaged - run: | - pip install . - - uses: uraimo/run-on-arch-action@v2 name: Build binary under QEMU id: build with: arch: aarch64 - distro: ubuntu20.04 + distro: ubuntu22.04 # Not required, but speeds up builds by storing container images in # a GitHub package registry. githubToken: ${{ github.token }} run: | + apt install python3 + pip install . + # aliens: requires no source ALIENS_NAME="aliens-${{ matrix.target }}.bin" ALIENS_PATH=${PWD}/${ALIENS_NAME} From bf9a9da0fb9f0f5a3a39fa2c505589b94a2b5337 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:36:01 +0530 Subject: [PATCH 07/18] apt update --- .github/workflows/build-cross.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index b073b90..350bc35 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -46,6 +46,7 @@ jobs: # a GitHub package registry. githubToken: ${{ github.token }} run: | + apt update apt install python3 pip install . From f9eed5da72c3736ad25f1d16060de22775d1f219 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:37:59 +0530 Subject: [PATCH 08/18] change job name --- .github/workflows/build-cross.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 350bc35..08d1bad 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -1,4 +1,4 @@ -name: Build binaries for all platforms +name: Build binaries for platforms under QEMU on: push: @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true jobs: - build: + build-cross: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: From d8b6b81c270917cbf5b1ea3fdb5b86c5951e792e Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:39:56 +0530 Subject: [PATCH 09/18] -y --- .github/workflows/build-cross.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 08d1bad..a9158b9 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -47,7 +47,7 @@ jobs: githubToken: ${{ github.token }} run: | apt update - apt install python3 + apt install python3 -y pip install . # aliens: requires no source From 6eaab80ef71e3338f4ae6e834cf353088d82ad99 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Tue, 21 May 2024 23:41:53 +0530 Subject: [PATCH 10/18] pip --- .github/workflows/build-cross.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index a9158b9..ef16637 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -47,7 +47,7 @@ jobs: githubToken: ${{ github.token }} run: | apt update - apt install python3 -y + apt install python3-pip -y pip install . # aliens: requires no source From e7a29dda0442aa5616f56f2d7c76e3e420fedd98 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 01:48:37 +0530 Subject: [PATCH 11/18] don't run unrelated pythons in test workflows --- .github/workflows/tox.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index a0f187e..531423f 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -11,7 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + include: + - { python-version: "3.8", tox-env: "py38" } + - { python-version: "3.9", tox-env: "py39" } + - { python-version: "3.10", tox-env: "py310" } + - { python-version: "3.11", tox-env: "py311" } + - { python-version: "3.12", tox-env: "py312" } name: Python ${{ matrix.python-version }} tests steps: - uses: actions/checkout@v2 @@ -23,4 +28,4 @@ jobs: - name: Install dependencies run: pip install -r requirements-dev.txt - name: Run tests and type checking - run: tox + run: tox -e ${{matrix.tox-env }} From fcd5bc94381187040107b5fbd349f335de737f7b Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:07:34 +0530 Subject: [PATCH 12/18] try this workaround --- .github/workflows/build-cross.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index ef16637..bd9a29e 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -45,6 +45,10 @@ jobs: # Not required, but speeds up builds by storing container images in # a GitHub package registry. githubToken: ${{ github.token }} + # workaround for $GITHUB_OUTPUT not available in run-on-arch: + # https://github.com/uraimo/run-on-arch-action/issues/52 + dockerRunArgs: | + --volume /home/runner/work/_temp:/home/runner/work/_temp run: | apt update apt install python3-pip -y From fc19b7fbeba887e61f75ca13cb7254603fe1c479 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:08:39 +0530 Subject: [PATCH 13/18] test it quicker --- .github/workflows/build-cross.yml | 102 +++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index bd9a29e..823ada6 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -59,38 +59,38 @@ jobs: ALIENS_PATH=${PWD}/${ALIENS_NAME} packaged $ALIENS_NAME 'pip install pygame' 'python -m pygame.examples.aliens' - # textual: requires no source - TEXTUAL_NAME="textual-${{ matrix.target }}.bin" - TEXTUAL_PATH=${PWD}/${TEXTUAL_NAME} - packaged $TEXTUAL_NAME 'pip install pygame' 'python -m textual' - - # IPython: requires no source - IPYTHON_NAME="ipython-${{ matrix.target }}.bin" - IPYTHON_PATH=${PWD}/${IPYTHON_NAME} - packaged $IPYTHON_NAME 'pip install ipython' 'ipython' - - # ./examples/mandelbrot - MANDELBROT_NAME="mandelbrot-${{ matrix.target }}.bin" - MANDELBROT_PATH=${PWD}/${MANDELBROT_NAME} - packaged $MANDELBROT_NAME 'pip install -r requirements.txt' 'python mandelbrot.py' ./example/mandelbrot - - # ./examples/minesweeper - MINESWEEPER_NAME="minesweeper-${{ matrix.target }}.bin" - MINESWEEPER_PATH=${PWD}/${MINESWEEPER_NAME} - packaged ./example/minesweeper - mv ./minesweeper.bin $MINESWEEPER_NAME + # # textual: requires no source + # TEXTUAL_NAME="textual-${{ matrix.target }}.bin" + # TEXTUAL_PATH=${PWD}/${TEXTUAL_NAME} + # packaged $TEXTUAL_NAME 'pip install pygame' 'python -m textual' + + # # IPython: requires no source + # IPYTHON_NAME="ipython-${{ matrix.target }}.bin" + # IPYTHON_PATH=${PWD}/${IPYTHON_NAME} + # packaged $IPYTHON_NAME 'pip install ipython' 'ipython' + + # # ./examples/mandelbrot + # MANDELBROT_NAME="mandelbrot-${{ matrix.target }}.bin" + # MANDELBROT_PATH=${PWD}/${MANDELBROT_NAME} + # packaged $MANDELBROT_NAME 'pip install -r requirements.txt' 'python mandelbrot.py' ./example/mandelbrot + + # # ./examples/minesweeper + # MINESWEEPER_NAME="minesweeper-${{ matrix.target }}.bin" + # MINESWEEPER_PATH=${PWD}/${MINESWEEPER_NAME} + # packaged ./example/minesweeper + # mv ./minesweeper.bin $MINESWEEPER_NAME # Setup output paths for upload echo "ALIENS_NAME=${ALIENS_NAME}" >> $GITHUB_OUTPUT echo "ALIENS_PATH=${ALIENS_PATH}" >> $GITHUB_OUTPUT - echo "TEXTUAL_NAME=${TEXTUAL_NAME}" >> $GITHUB_OUTPUT - echo "TEXTUAL_PATH=${TEXTUAL_PATH}" >> $GITHUB_OUTPUT - echo "IPYTHON_NAME=${IPYTHON_NAME}" >> $GITHUB_OUTPUT - echo "IPYTHON_PATH=${IPYTHON_PATH}" >> $GITHUB_OUTPUT - echo "MANDELBROT_NAME=${MANDELBROT_NAME}" >> $GITHUB_OUTPUT - echo "MANDELBROT_PATH=${MANDELBROT_PATH}" >> $GITHUB_OUTPUT - echo "MINESWEEPER_NAME=${MINESWEEPER_NAME}" >> $GITHUB_OUTPUT - echo "MINESWEEPER_PATH=${MINESWEEPER_PATH}" >> $GITHUB_OUTPUT + # echo "TEXTUAL_NAME=${TEXTUAL_NAME}" >> $GITHUB_OUTPUT + # echo "TEXTUAL_PATH=${TEXTUAL_PATH}" >> $GITHUB_OUTPUT + # echo "IPYTHON_NAME=${IPYTHON_NAME}" >> $GITHUB_OUTPUT + # echo "IPYTHON_PATH=${IPYTHON_PATH}" >> $GITHUB_OUTPUT + # echo "MANDELBROT_NAME=${MANDELBROT_NAME}" >> $GITHUB_OUTPUT + # echo "MANDELBROT_PATH=${MANDELBROT_PATH}" >> $GITHUB_OUTPUT + # echo "MINESWEEPER_NAME=${MINESWEEPER_NAME}" >> $GITHUB_OUTPUT + # echo "MINESWEEPER_PATH=${MINESWEEPER_PATH}" >> $GITHUB_OUTPUT - name: Upload aliens uses: actions/upload-artifact@v4 @@ -98,29 +98,29 @@ jobs: name: ${{ steps.build.outputs.ALIENS_NAME }} path: ${{ steps.build.outputs.ALIENS_PATH }} - - name: Upload textual - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.build.outputs.TEXTUAL_NAME }} - path: ${{ steps.build.outputs.TEXTUAL_PATH }} - - - name: Upload IPython - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.build.outputs.IPYTHON_NAME }} - path: ${{ steps.build.outputs.IPYTHON_PATH }} - - - name: Upload mandelbrot - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.build.outputs.MANDELBROT_NAME }} - path: ${{ steps.build.outputs.MANDELBROT_PATH }} - - - name: Upload minesweeper - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.build.outputs.MINESWEEPER_NAME }} - path: ${{ steps.build.outputs.MINESWEEPER_PATH }} + # - name: Upload textual + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ steps.build.outputs.TEXTUAL_NAME }} + # path: ${{ steps.build.outputs.TEXTUAL_PATH }} + + # - name: Upload IPython + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ steps.build.outputs.IPYTHON_NAME }} + # path: ${{ steps.build.outputs.IPYTHON_PATH }} + + # - name: Upload mandelbrot + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ steps.build.outputs.MANDELBROT_NAME }} + # path: ${{ steps.build.outputs.MANDELBROT_PATH }} + + # - name: Upload minesweeper + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ steps.build.outputs.MINESWEEPER_NAME }} + # path: ${{ steps.build.outputs.MINESWEEPER_PATH }} - name: Publish packages uses: softprops/action-gh-release@v1 From 0908549c4fc7b5c1423601ebc2059ce75c62635f Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:19:04 +0530 Subject: [PATCH 14/18] debug --- .github/workflows/build-cross.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 823ada6..1b860c8 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -81,6 +81,7 @@ jobs: # mv ./minesweeper.bin $MINESWEEPER_NAME # Setup output paths for upload + GITHUB_OUTPUT="" echo "ALIENS_NAME=${ALIENS_NAME}" >> $GITHUB_OUTPUT echo "ALIENS_PATH=${ALIENS_PATH}" >> $GITHUB_OUTPUT # echo "TEXTUAL_NAME=${TEXTUAL_NAME}" >> $GITHUB_OUTPUT @@ -92,6 +93,8 @@ jobs: # echo "MINESWEEPER_NAME=${MINESWEEPER_NAME}" >> $GITHUB_OUTPUT # echo "MINESWEEPER_PATH=${MINESWEEPER_PATH}" >> $GITHUB_OUTPUT + - run: echo github output is $GITHUB_OUTPUT + - name: Upload aliens uses: actions/upload-artifact@v4 with: From 4944599df2caeb31df448d41c650d47d6202c47b Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:19:41 +0530 Subject: [PATCH 15/18] debug quicker --- .github/workflows/build-cross.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 1b860c8..4339942 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -57,7 +57,7 @@ jobs: # aliens: requires no source ALIENS_NAME="aliens-${{ matrix.target }}.bin" ALIENS_PATH=${PWD}/${ALIENS_NAME} - packaged $ALIENS_NAME 'pip install pygame' 'python -m pygame.examples.aliens' + # packaged $ALIENS_NAME 'pip install pygame' 'python -m pygame.examples.aliens' # # textual: requires no source # TEXTUAL_NAME="textual-${{ matrix.target }}.bin" From 8120fc0037e7fad71f8e30a041f6756f984da267 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:23:55 +0530 Subject: [PATCH 16/18] shellcheck wtf --- .github/workflows/build-cross.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 4339942..53f50e9 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -82,8 +82,8 @@ jobs: # Setup output paths for upload GITHUB_OUTPUT="" - echo "ALIENS_NAME=${ALIENS_NAME}" >> $GITHUB_OUTPUT - echo "ALIENS_PATH=${ALIENS_PATH}" >> $GITHUB_OUTPUT + echo "ALIENS_NAME=${ALIENS_NAME}" >> "${GITHUB_OUTPUT}" + echo "ALIENS_PATH=${ALIENS_PATH}" >> "${GITHUB_OUTPUT}" # echo "TEXTUAL_NAME=${TEXTUAL_NAME}" >> $GITHUB_OUTPUT # echo "TEXTUAL_PATH=${TEXTUAL_PATH}" >> $GITHUB_OUTPUT # echo "IPYTHON_NAME=${IPYTHON_NAME}" >> $GITHUB_OUTPUT From 88fc55a3c41d9e0256bf2ff07fab54de8279a10c Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:30:05 +0530 Subject: [PATCH 17/18] fix this mess --- .github/workflows/build-cross.yml | 107 +++++++++++++++--------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 53f50e9..924c1d0 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -59,39 +59,38 @@ jobs: ALIENS_PATH=${PWD}/${ALIENS_NAME} # packaged $ALIENS_NAME 'pip install pygame' 'python -m pygame.examples.aliens' - # # textual: requires no source - # TEXTUAL_NAME="textual-${{ matrix.target }}.bin" - # TEXTUAL_PATH=${PWD}/${TEXTUAL_NAME} - # packaged $TEXTUAL_NAME 'pip install pygame' 'python -m textual' - - # # IPython: requires no source - # IPYTHON_NAME="ipython-${{ matrix.target }}.bin" - # IPYTHON_PATH=${PWD}/${IPYTHON_NAME} - # packaged $IPYTHON_NAME 'pip install ipython' 'ipython' - - # # ./examples/mandelbrot - # MANDELBROT_NAME="mandelbrot-${{ matrix.target }}.bin" - # MANDELBROT_PATH=${PWD}/${MANDELBROT_NAME} - # packaged $MANDELBROT_NAME 'pip install -r requirements.txt' 'python mandelbrot.py' ./example/mandelbrot - - # # ./examples/minesweeper - # MINESWEEPER_NAME="minesweeper-${{ matrix.target }}.bin" - # MINESWEEPER_PATH=${PWD}/${MINESWEEPER_NAME} - # packaged ./example/minesweeper - # mv ./minesweeper.bin $MINESWEEPER_NAME + # textual: requires no source + TEXTUAL_NAME="textual-${{ matrix.target }}.bin" + TEXTUAL_PATH=${PWD}/${TEXTUAL_NAME} + packaged $TEXTUAL_NAME 'pip install pygame' 'python -m textual' + + # IPython: requires no source + IPYTHON_NAME="ipython-${{ matrix.target }}.bin" + IPYTHON_PATH=${PWD}/${IPYTHON_NAME} + packaged $IPYTHON_NAME 'pip install ipython' 'ipython' + + # ./examples/mandelbrot + MANDELBROT_NAME="mandelbrot-${{ matrix.target }}.bin" + MANDELBROT_PATH=${PWD}/${MANDELBROT_NAME} + packaged $MANDELBROT_NAME 'pip install -r requirements.txt' 'python mandelbrot.py' ./example/mandelbrot + + # ./examples/minesweeper + MINESWEEPER_NAME="minesweeper-${{ matrix.target }}.bin" + MINESWEEPER_PATH=${PWD}/${MINESWEEPER_NAME} + packaged ./example/minesweeper + mv ./minesweeper.bin $MINESWEEPER_NAME # Setup output paths for upload - GITHUB_OUTPUT="" - echo "ALIENS_NAME=${ALIENS_NAME}" >> "${GITHUB_OUTPUT}" - echo "ALIENS_PATH=${ALIENS_PATH}" >> "${GITHUB_OUTPUT}" - # echo "TEXTUAL_NAME=${TEXTUAL_NAME}" >> $GITHUB_OUTPUT - # echo "TEXTUAL_PATH=${TEXTUAL_PATH}" >> $GITHUB_OUTPUT - # echo "IPYTHON_NAME=${IPYTHON_NAME}" >> $GITHUB_OUTPUT - # echo "IPYTHON_PATH=${IPYTHON_PATH}" >> $GITHUB_OUTPUT - # echo "MANDELBROT_NAME=${MANDELBROT_NAME}" >> $GITHUB_OUTPUT - # echo "MANDELBROT_PATH=${MANDELBROT_PATH}" >> $GITHUB_OUTPUT - # echo "MINESWEEPER_NAME=${MINESWEEPER_NAME}" >> $GITHUB_OUTPUT - # echo "MINESWEEPER_PATH=${MINESWEEPER_PATH}" >> $GITHUB_OUTPUT + echo ::set-output name=ALIENS_NAME::"${ALIENS_NAME}" + echo ::set-output name=ALIENS_PATH::"${ALIENS_PATH}" + echo ::set-output name=TEXTUAL_NAME::"${TEXTUAL_NAME}" + echo ::set-output name=TEXTUAL_PATH::"${TEXTUAL_PATH}" + echo ::set-output name=IPYTHON_NAME::"${IPYTHON_NAME}" + echo ::set-output name=IPYTHON_PATH::"${IPYTHON_PATH}" + echo ::set-output name=MANDELBROT_NAME::"${MANDELBROT_NAME}" + echo ::set-output name=MANDELBROT_PATH::"${MANDELBROT_PATH}" + echo ::set-output name=MINESWEEPER_NAME::"${MINESWEEPER_NAME}" + echo ::set-output name=MINESWEEPER_PATH::"${MINESWEEPER_PATH}" - run: echo github output is $GITHUB_OUTPUT @@ -101,29 +100,29 @@ jobs: name: ${{ steps.build.outputs.ALIENS_NAME }} path: ${{ steps.build.outputs.ALIENS_PATH }} - # - name: Upload textual - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ steps.build.outputs.TEXTUAL_NAME }} - # path: ${{ steps.build.outputs.TEXTUAL_PATH }} - - # - name: Upload IPython - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ steps.build.outputs.IPYTHON_NAME }} - # path: ${{ steps.build.outputs.IPYTHON_PATH }} - - # - name: Upload mandelbrot - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ steps.build.outputs.MANDELBROT_NAME }} - # path: ${{ steps.build.outputs.MANDELBROT_PATH }} - - # - name: Upload minesweeper - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ steps.build.outputs.MINESWEEPER_NAME }} - # path: ${{ steps.build.outputs.MINESWEEPER_PATH }} + - name: Upload textual + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.TEXTUAL_NAME }} + path: ${{ steps.build.outputs.TEXTUAL_PATH }} + + - name: Upload IPython + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.IPYTHON_NAME }} + path: ${{ steps.build.outputs.IPYTHON_PATH }} + + - name: Upload mandelbrot + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.MANDELBROT_NAME }} + path: ${{ steps.build.outputs.MANDELBROT_PATH }} + + - name: Upload minesweeper + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.build.outputs.MINESWEEPER_NAME }} + path: ${{ steps.build.outputs.MINESWEEPER_PATH }} - name: Publish packages uses: softprops/action-gh-release@v1 From 9b064dbe2301f28b6556e399b21b1e846985a993 Mon Sep 17 00:00:00 2001 From: Tushar Sadhwani Date: Wed, 22 May 2024 02:54:00 +0530 Subject: [PATCH 18/18] cleanup --- .github/workflows/build-cross.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml index 924c1d0..a0bc14b 100644 --- a/.github/workflows/build-cross.yml +++ b/.github/workflows/build-cross.yml @@ -45,10 +45,6 @@ jobs: # Not required, but speeds up builds by storing container images in # a GitHub package registry. githubToken: ${{ github.token }} - # workaround for $GITHUB_OUTPUT not available in run-on-arch: - # https://github.com/uraimo/run-on-arch-action/issues/52 - dockerRunArgs: | - --volume /home/runner/work/_temp:/home/runner/work/_temp run: | apt update apt install python3-pip -y @@ -92,8 +88,6 @@ jobs: echo ::set-output name=MINESWEEPER_NAME::"${MINESWEEPER_NAME}" echo ::set-output name=MINESWEEPER_PATH::"${MINESWEEPER_PATH}" - - run: echo github output is $GITHUB_OUTPUT - - name: Upload aliens uses: actions/upload-artifact@v4 with: