From d5295aa889b5fc481c3647fb43b0edf8e3ec0e46 Mon Sep 17 00:00:00 2001 From: plasmagoat Date: Mon, 9 Jun 2025 13:04:02 +0200 Subject: [PATCH] more info --- .forgejo/workflows/build-image.yml | 38 +++++++++++++++++++++++------- flake-metadata.json | 1 + 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 flake-metadata.json diff --git a/.forgejo/workflows/build-image.yml b/.forgejo/workflows/build-image.yml index 46faffe..2f3b6b5 100644 --- a/.forgejo/workflows/build-image.yml +++ b/.forgejo/workflows/build-image.yml @@ -125,22 +125,44 @@ jobs: - name: Set VERSION from tag or fallback id: version run: | - if [ -n "${GITHUB_REF_NAME}" ]; - echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" + if [[ "${{ github.ref_type }}" == "tag" ]]; then + echo "tag_name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" else - echo "tag=dev-$(date +%s)" >> "$GITHUB_OUTPUT" - fi + echo "tag_name=dev-$(date +%Y%m%d)" >> "$GITHUB_OUTPUT" + echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT" + + - name: Parse image filename + id: image + run: | + IMAGE=$(basename ${{ steps.artifact.outputs.download-path }}/*.vma.zst) + echo "Image filename: $IMAGE" + echo "filename=$IMAGE" >> "$GITHUB_OUTPUT" + + # - name: Extract flake metadata + # id: meta + # run: | + # META=$(nix flake metadata --json | jq -r '.locks.nodes.root.inputs | to_entries[] | "* \(.key): \(.value.locked.url) @ \(.value.locked.rev)"') + # echo "metadata<> $GITHUB_OUTPUT + # echo "$META" >> $GITHUB_OUTPUT + # echo "EOF" >> $GITHUB_OUTPUT - name: Create Forgejo Release uses: https://code.forgejo.org/sheik/forgejo-release@v2.6.0 with: title: "NixOS Base Image ${{ steps.version.outputs.tag }}" prerelease: ${{ github.ref_type != 'tag' }} - override: ${{ github.ref_type == 'tag' }} - tag: ${{ steps.version.outputs.tag }} + tag: ${{ steps.version.outputs.tag_name }} direction: upload release-notes: | - This release contains the NixOS base image for Proxmox labeled `${{ steps.version.outputs.tag }}`. + ✅ **Base NixOS image uploaded** + + **🧱 Image File:** + `/var/lib/vz/dump/${{ steps.image.outputs.filename }}` + + **🔗 Build Logs:** + [View Actions Run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + **🔐 Flake Revision:** + `${{ github.sha }}` - Image uploaded as template on proxmox filename: `${{ needs.build.steps.build_image.outputs.image_path_from_build }}`. release-dir: "${{ steps.artifact.outputs.download-path }}/nix-support" diff --git a/flake-metadata.json b/flake-metadata.json new file mode 100644 index 0000000..a3fcd03 --- /dev/null +++ b/flake-metadata.json @@ -0,0 +1 @@ +{"description":"NixOS Base Image","dirtyRevision":"791297e76075625785e244608fdd49798ff34681-dirty","fingerprint":"2950ea4491309e7b925bd8339458758067c3d0048668e1f7b01eff0c86dfa03e","lastModified":1749463930,"locked":{"__final":true,"dirtyRev":"791297e76075625785e244608fdd49798ff34681-dirty","dirtyShortRev":"791297e-dirty","lastModified":1749463930,"narHash":"sha256-GlFiPaRuel558R4ev4+hd73pFQMKf6GIamLBIKgw3Dk=","type":"git","url":"file:///home/plasmagoat/nixos-base-image"},"locks":{"nodes":{"nixlib":{"locked":{"lastModified":1736643958,"narHash":"sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=","owner":"nix-community","repo":"nixpkgs.lib","rev":"1418bc28a52126761c02dd3d89b2d8ca0f521181","type":"github"},"original":{"owner":"nix-community","repo":"nixpkgs.lib","type":"github"}},"nixos-generators":{"inputs":{"nixlib":"nixlib","nixpkgs":["nixpkgs"]},"locked":{"lastModified":1747663185,"narHash":"sha256-Obh50J+O9jhUM/FgXtI3he/QRNiV9+J53+l+RlKSaAk=","owner":"nix-community","repo":"nixos-generators","rev":"ee07ba0d36c38e9915c55d2ac5a8fb0f05f2afcc","type":"github"},"original":{"owner":"nix-community","repo":"nixos-generators","type":"github"}},"nixpkgs":{"locked":{"lastModified":1749324915,"narHash":"sha256-aSpVf4BsMsXIlb5lUuF/N/nK1gbvwCKpRcyNEXoDb5k=","owner":"nixos","repo":"nixpkgs","rev":"0e9e520ad13e41b04e90db358f0bba0970c42180","type":"github"},"original":{"owner":"nixos","repo":"nixpkgs","type":"github"}},"root":{"inputs":{"nixos-generators":"nixos-generators","nixpkgs":"nixpkgs"}}},"root":"root","version":7},"original":{"type":"git","url":"file:///home/plasmagoat/nixos-base-image"},"originalUrl":"git+file:///home/plasmagoat/nixos-base-image","path":"/nix/store/nxvw4ra0j178d0hw35dgrz14v6a076sj-source","resolved":{"type":"git","url":"file:///home/plasmagoat/nixos-base-image"},"resolvedUrl":"git+file:///home/plasmagoat/nixos-base-image","url":"git+file:///home/plasmagoat/nixos-base-image"}