caxa icon indicating copy to clipboard operation
caxa copied to clipboard

Create a GitHub Action to compile with caxa

Open leafac opened this issue 4 years ago • 2 comments
trafficstars

This would, for example, abstract away the complexity of emulating ARM & creating releases, and so forth.

Idea given by @mfbx9da4

leafac avatar May 26 '21 11:05 leafac

I just made it in my project, I think it can help you.

https://github.com/SOVLOOKUP/starry/blob/master/.github/workflows/node.js.yml

It includes:

  1. Compile and compress source code (using tsup)
  2. Minimize dependencies size (based on dependencies-resolver)
  3. Cross-platform compilation
  4. Automated release

SOVLOOKUP avatar Jun 22 '21 02:06 SOVLOOKUP

I'm not that familiar with writing custom actions, but I was able to build arm and amr64 executables using docker.

Here is a snippet to do so for arm:

jobs:
  build-arm:
    runs-on: ubuntu-latest
    steps:
      # Checkout
      - uses: actions/checkout@v2

      # Setup QEMU
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1

      # Build the image
      - name: Build with caxa for arm
        run: |
          docker run --rm --platform linux/arm/v7 -v $(pwd):/app --workdir="/app" --user 1000:1000 node:lts sh -c "npm ci; npx caxa ... "

To do the same on arm64, simply change --platform linux/arm/v7 to --platform linux/arm64

matteosacchetto avatar Dec 21 '21 18:12 matteosacchetto

I followed your methodology @matteosacchetto and ended up with this:

https://github.com/emmercm/igir/blob/5b6ba8cf650626651458e65b4080a40df5c0caff/.github/workflows/compile.yml

emmercm avatar May 02 '23 02:05 emmercm

Hi y’all,

Thanks for using caxa and for the conversation here.

I’ve been thinking about the broad strategy employed by caxa and concluded that there is a better way to solve the problem. It doesn’t use stubs at all, so it sidesteps this whole issue.

It’s a different enough approach that I think it deserves a new name, and it’s part of a bigger toolset that I’m building, which I call Radically Straightforward · Package.

I’m deprecating caxa and archiving this repository. I invite you to continue the conversation in Radically Straightforward’s issues.

Best.

leafac avatar Nov 21 '23 15:11 leafac