## SPDX-FileCopyrightText: 2025 Gergely Nagy ## SPDX-FileContributor: Gergely Nagy ## ## SPDX-License-Identifier: MIT name: release on: push: tags: - 'iocaine-*' jobs: info: runs-on: nixos-latest outputs: pkg-version: ${{ steps.version.outputs.pkg-version }} steps: - name: checkout uses: actions/checkout@v4 - name: extract the version from the tag id: version run: | echo "pkg-version=${GITHUB_REF_NAME//iocaine-}" | tee -a "${GITHUB_OUTPUT}" binary-static: runs-on: nixos-latest needs: info strategy: matrix: system: - x86_64-linux env: PKG_VERSION: ${{ needs.info.outputs.pkg-version }} steps: - name: checkout uses: actions/checkout@v4 - name: setup magic attic cache uses: actions/magic-attic-cache@main with: CELLAR_TOKEN: ${{ secrets.CELLAR_TOKEN }} - name: build uses: actions/nix/build@main with: logs: true package: packages.${{ matrix.system }}.iocaine-static - name: compress the binary run: | zstd result/bin/iocaine \ -o iocaine-${PKG_VERSION}.${{ matrix.system }}.zst - name: upload package run: | curl --user :${{ secrets.DOCKER_PASSWORD }} -XDELETE \ https://git.madhouse-project.org/api/packages/iocaine/generic/iocaine-binaries/${PKG_VERSION} curl --user :${{ secrets.DOCKER_PASSWORD }} \ --upload-file iocaine-${PKG_VERSION}.${{ matrix.system }}.zst \ --fail \ https://git.madhouse-project.org/api/packages/iocaine/generic/iocaine-binaries/${PKG_VERSION}/iocaine-${PKG_VERSION}.${{ matrix.system }}.zst container: runs-on: nixos-latest needs: - info - binary-static env: PKG_VERSION: ${{ needs.info.outputs.pkg-version }} steps: - name: checkout uses: actions/checkout@v4 - name: setup magic attic cache uses: actions/magic-attic-cache@main with: CELLAR_TOKEN: ${{ secrets.CELLAR_TOKEN }} - name: build the container image uses: actions/nix/build@main with: logs: true package: container-image - name: load the container image into docker run: | docker load