fix(pub-con): Check if tar or zip to allow apptainers

This commit is contained in:
2026-01-30 16:32:58 +01:00
parent 5e54e04eef
commit c6adb94cf0
3 changed files with 19 additions and 12 deletions
+10 -6
View File
@@ -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 \
+8 -5
View File
@@ -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
+1 -1
View File
@@ -83,7 +83,7 @@ runs:
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}",
"assets": [
"RELEASE_NOTES.md",
".version",
"VERSION",
"src/*.fsproj",
"src/*/**.fsproj"
]