ci: Prepare for cross-building binaries
Some checks are pending
build / binary (push) Waiting to run
build / binary-static (x86_64-linux) (push) Waiting to run
build / container (push) Waiting to run
build / clippy (push) Waiting to run
documentation / documentation (push) Waiting to run
documentation / notification (push) Blocked by required conditions
lint / linting (push) Waiting to run

Include the system name in the cross-built binary file, and put it under
`iocaine-binaries/latest`, rather than `iocaine/${{ version }}`, to
match how the container image is tagged. Releases will have their own
version.

Documentation updated to point to the new place.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2025-02-04 08:37:10 +01:00
parent 0b76a1633e
commit 099cefb927
No known key found for this signature in database
2 changed files with 11 additions and 14 deletions

View file

@ -39,6 +39,10 @@ jobs:
binary-static:
runs-on: nixos-latest
strategy:
matrix:
system:
- x86_64-linux
steps:
- name: checkout
uses: actions/checkout@v4
@ -52,31 +56,24 @@ jobs:
uses: actions/nix/build@main
with:
logs: true
package: iocaine-static
package: packages.${{ matrix.system }}.iocaine-static
- name: compress the binary
uses: actions/nix/develop@main
with:
run: |
zstd result/bin/iocaine
- name: determine the version
uses: actions/nix/develop@main
id: ver
with:
run: |
echo "ver=$(cargo info -q iocaine | grep "^version:" | cut -d " " -f 2)" >>"${GITHUB_OUTPUT}"
zstd result/bin/iocaine -o iocaine-latest.${{ matrix.system }}.zst
- name: upload package
uses: actions/nix/develop@main
with:
run: |
curl --user :${{ secrets.DOCKER_PASSWORD }} -XDELETE \
https://git.madhouse-project.org/api/packages/algernon/generic/iocaine/${{ steps.ver.outputs.ver }}
https://git.madhouse-project.org/api/packages/algernon/generic/iocaine-binaries/latest
curl --user :${{ secrets.DOCKER_PASSWORD }} \
--upload-file result/bin/iocaine.zst \
--upload-file iocaine-latest.${{ matrix.system }}.zst \
--fail \
https://git.madhouse-project.org/api/packages/algernon/generic/iocaine/${{ steps.ver.outputs.ver }}/iocaine.zst
https://git.madhouse-project.org/api/packages/algernon/generic/iocaine-binaries/latest/iocaine-latest.${{ matrix.system }}.zst
container:
runs-on: nixos-latest

View file

@ -7,10 +7,10 @@ How to deploy `iocaine` highly depends on what kind of system you're using. Belo
# Compiling `iocaine`
Automatically built binaries are available for x86-64 Linux platforms (statically built against musl libc) [here](https://git.madhouse-project.org/algernon/-/packages/generic/iocaine/0.1.0-snapshot). To download it, you can use a command like the following:
Automatically built binaries are available for x86-64 Linux platforms (statically built against musl libc) [here](https://git.madhouse-project.org/algernon/-/packages/generic/iocaine-binaries/latest). To download it, you can use a command like the following:
```sh
curl -s https://git.madhouse-project.org/api/packages/algernon/generic/iocaine/0.1.0-snapshot/iocaine.zst | \
curl -s https://git.madhouse-project.org/api/packages/algernon/generic/iocaine-binaries/latest/iocaine-latest.x86_64-linux.zst | \
unzstd - -o /usr/local/bin/iocaine && chmod +x /usr/local/bin/iocaine
```