From c6adb94cf0f8740a781179179ce490fb310d460e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Fri, 30 Jan 2026 16:32:58 +0100 Subject: [PATCH] fix(pub-con): Check if tar or zip to allow apptainers --- publish-container/action.yaml | 16 ++++++++++------ publish-nuget/action.yaml | 13 ++++++++----- sr/action.yaml | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/publish-container/action.yaml b/publish-container/action.yaml index 2bf7d82..f41a54f 100644 --- a/publish-container/action.yaml +++ b/publish-container/action.yaml @@ -62,19 +62,23 @@ runs: skopeo login \ --username "${{ github.actor }}" \ --password "${{ inputs.container-token }}" \ - "${{ vars.REGISTRY }}" + "${{ inputs.REGISTRY }}" # Build container nix-build -A containers."${{ inputs.project }}" \ --argstr env "${{ steps.envvars.outputs.ENV }}" # The Nix build creates a compressed tar.gz file, we need to extract it first + IMAGE_TAR="$(readlink -f result)" cd /tmp/skopeo - cp ${GITHUB_WORKSPACE}/result ./docker-image.tar.gz - gunzip docker-image.tar.gz - - # ls -alh ./result - # skopeo inspect docker-archive://$(readlink -f ./result) + if file "${IMAGE_TAR}" | grep -qi gzip; then + echo "Detected gzip-compressed image" + cp "${IMAGE_TAR}" docker-image.tar.gz + gunzip docker-image.tar.gz + else + echo "Detected uncompressed image" + cp "${IMAGE_TAR}" docker-image.tar + fi echo "Pushing image: ${{ steps.envvars.outputs.IMAGE_NAME }}" skopeo copy \ diff --git a/publish-nuget/action.yaml b/publish-nuget/action.yaml index 6fe7dfc..e5354c5 100644 --- a/publish-nuget/action.yaml +++ b/publish-nuget/action.yaml @@ -3,7 +3,10 @@ name: "publish-nuget" description: "Publishes a NuGet package to a Gitea-hosted NuGet registry and attests to its contents." inputs: package-path: - description: "Path to the package directory relative to src/, e.g. Oceanbox.FvcomKit" + description: "Path to the package directory to the root of the repo, e.g. src/Oceanbox.FvcomKit" + required: true + package-name: + description: "Name of the package e.g. Oceanbox.FvcomKit" required: true nuget-key: description: "API key with which to authenticate to the NuGet registry." @@ -53,25 +56,25 @@ runs: shell: bash run: | nix-shell --run "set -o pipefail; set -o nounset; set -o errexit; - dotnet restore src/${{ inputs.package-path }} ${{ inputs.dotnet-restore-args }}" + dotnet restore ${{ inputs.package-path }} ${{ inputs.dotnet-restore-args }}" - name: Build shell: bash run: | nix-shell --run "set -o pipefail; set -o nounset; set -o errexit; - dotnet build --no-restore --configuration ${{ inputs.configuration }} src/${{ inputs.package-path }} ${{ inputs.dotnet-build-args }}" + dotnet build --no-restore --configuration ${{ inputs.configuration }} ${{ inputs.package-path }} ${{ inputs.dotnet-build-args }}" - name: Pack shell: bash run: | nix-shell --run "set -o pipefail; set -o nounset; set -o errexit; - dotnet pack src/${{ inputs.package-path }} --no-restore ${{ inputs.dotnet-pack-args }} --configuration ${{ inputs.configuration }} -o ${{ inputs.nupkg-dir }}" + dotnet pack ${{ inputs.package-path }} --no-restore ${{ inputs.dotnet-pack-args }} --configuration ${{ inputs.configuration }} -o ${{ inputs.nupkg-dir }}" - name: Publish NuGet package shell: bash run: | nix-shell --run "set -o pipefail; set -o nounset; set -o errexit; - dotnet nuget push ${{ inputs.nupkg-dir }}/${{ inputs.package-path }}.*.nupkg --api-key ${{ inputs.nuget-key }} --source '${{ inputs.source-name }}' --skip-duplicate" + dotnet nuget push ${{ inputs.nupkg-dir }}/${{ inputs.package-name }}.*.nupkg --api-key ${{ inputs.nuget-key }} --source '${{ inputs.source-name }}' --skip-duplicate" # TODO: Add attestation # - name: Attest Build Provenance diff --git a/sr/action.yaml b/sr/action.yaml index 00ef346..0f42bb4 100644 --- a/sr/action.yaml +++ b/sr/action.yaml @@ -83,7 +83,7 @@ runs: "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}", "assets": [ "RELEASE_NOTES.md", - ".version", + "VERSION", "src/*.fsproj", "src/*/**.fsproj" ]