caxa
caxa copied to clipboard
Create a GitHub Action to compile with caxa
This would, for example, abstract away the complexity of emulating ARM & creating releases, and so forth.
Idea given by @mfbx9da4
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:
- Compile and compress source code (using tsup)
- Minimize dependencies size (based on dependencies-resolver)
- Cross-platform compilation
- Automated release
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
I followed your methodology @matteosacchetto and ended up with this:
https://github.com/emmercm/igir/blob/5b6ba8cf650626651458e65b4080a40df5c0caff/.github/workflows/compile.yml
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.