config: Update 3 files
Some checks failed
Test and Publish Templates / test-and-publish (push) Failing after 14s

This commit is contained in:
Your Name
2025-09-02 14:03:34 +12:00
parent 1b95675ef6
commit 1de4faf86e
3 changed files with 14 additions and 3 deletions

View File

@@ -41,6 +41,9 @@ jobs:
# Install tar for packaging # Install tar for packaging
which tar || sudo apt-get update && sudo apt-get install -y tar which tar || sudo apt-get update && sudo apt-get install -y tar
# Install xxhash for calculating template hashes
which xxhsum || sudo apt-get update && sudo apt-get install -y xxhash
- name: Bump versions if requested - name: Bump versions if requested
if: inputs.bump_version != 'none' if: inputs.bump_version != 'none'
run: | run: |

View File

@@ -28,6 +28,9 @@ jobs:
# Install tar for packaging # Install tar for packaging
which tar || sudo apt-get update && sudo apt-get install -y tar which tar || sudo apt-get update && sudo apt-get install -y tar
# Install xxhash for calculating template hashes
which xxhsum || sudo apt-get update && sudo apt-get install -y xxhash
- name: Run tests - name: Run tests
run: | run: |
chmod +x test.sh chmod +x test.sh

View File

@@ -115,21 +115,26 @@ for TEMPLATE in $TEMPLATES_TO_PUBLISH; do
SIZE=$(du -h "$TARBALL" | cut -f1) SIZE=$(du -h "$TARBALL" | cut -f1)
info "Created $TEMPLATE.tgz ($SIZE)" info "Created $TEMPLATE.tgz ($SIZE)"
# Calculate XXHash64 of the unpacked template contents
info "Calculating XXHash64 for $TEMPLATE"
XXHASH=$(find "$TEMPLATE" -type f -exec xxhsum -H64 {} \; | sort | xxhsum -H64 | cut -d' ' -f1)
info "XXHash64 for $TEMPLATE: $XXHASH"
# Upload to templates.dropshell.app using sos # Upload to templates.dropshell.app using sos
info "Uploading $TEMPLATE to templates.dropshell.app" info "Uploading $TEMPLATE to templates.dropshell.app"
# Always upload with :latest tag # Always upload with :latest tag
sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:latest" || die "Failed to upload $TEMPLATE:latest" sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:latest" --metadata "templateXXHash64=$XXHASH" || die "Failed to upload $TEMPLATE:latest"
info "Uploaded ${TEMPLATE}:latest" info "Uploaded ${TEMPLATE}:latest"
# Also upload with specific version tag # Also upload with specific version tag
sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:${VERSION}" || die "Failed to upload $TEMPLATE:${VERSION}" sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:${VERSION}" --metadata "templateXXHash64=$XXHASH" || die "Failed to upload $TEMPLATE:${VERSION}"
info "Uploaded ${TEMPLATE}:${VERSION}" info "Uploaded ${TEMPLATE}:${VERSION}"
# If we have a major version, also tag with major version only (e.g., v1) # If we have a major version, also tag with major version only (e.g., v1)
MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1) MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1)
if [ -n "$MAJOR_VERSION" ]; then if [ -n "$MAJOR_VERSION" ]; then
sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:v${MAJOR_VERSION}" || die "Failed to upload $TEMPLATE:v${MAJOR_VERSION}" sos upload templates.dropshell.app "$TARBALL" "${TEMPLATE}:v${MAJOR_VERSION}" --metadata "templateXXHash64=$XXHASH" || die "Failed to upload $TEMPLATE:v${MAJOR_VERSION}"
info "Uploaded ${TEMPLATE}:v${MAJOR_VERSION}" info "Uploaded ${TEMPLATE}:v${MAJOR_VERSION}"
fi fi