diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 8bcd663..c0a3f3c 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -19,7 +19,7 @@ on: - 'templates/**' jobs: - build: + binary: runs-on: nixos-latest steps: - name: checkout @@ -36,6 +36,57 @@ jobs: logs: true package: iocaine + binary-static: + runs-on: nixos-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: setup magic attic cache + uses: actions/magic-attic-cache@main + with: + ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} + + - name: build + uses: actions/nix/build@main + with: + logs: true + package: 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}"" + + - 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 }} + curl --user :${{ secrets.DOCKER_PASSWORD }} \ + --upload-file result/bin/iocaine.zstd \ + https://git.madhouse-project.org/api/packages/algernon/generic/iocaine/${{ steps.ver.outputs.ver }}/iocaine.zstd + + container: + runs-on: nixos-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: setup magic attic cache + uses: actions/magic-attic-cache@main + with: + ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }} + - name: build the container image uses: actions/nix/build@main with: