From 099cefb927e5669d9590b21e71acf48a24827229 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 4 Feb 2025 08:37:10 +0100 Subject: [PATCH] ci: Prepare for cross-building binaries 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 --- .forgejo/workflows/build.yaml | 21 +++++++++------------ docs/content/deploying/iocaine.md | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index d5a0e5c..a37ac33 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -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 diff --git a/docs/content/deploying/iocaine.md b/docs/content/deploying/iocaine.md index 4330a1d..37359aa 100644 --- a/docs/content/deploying/iocaine.md +++ b/docs/content/deploying/iocaine.md @@ -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 ```