diff --git a/build.sh b/build.sh index 1e23705..de8e842 100755 --- a/build.sh +++ b/build.sh @@ -16,7 +16,7 @@ FILES=("xz" "xz.asc" "xz.sha256" "xz.sha256.asc") # Download Gitea Binaries and Signatures for ARCH in "${ARCHS[@]}"; do - echo "Downloading Gitea ${VERSION} for ${ARCH}..." + echo "Downloading Gitea ${VERSION} for ${ARCH} …" if [[ ! -d "dist/${ARCH}" ]]; then echo "Creating directory dist/${ARCH}" mkdir "dist/${ARCH}" @@ -25,18 +25,18 @@ for ARCH in "${ARCHS[@]}"; do FILE_NAME="gitea-${VERSION}-linux-${ARCH}.${FILE}" FILE_URL="${GITEA_BASE_URL}/${FILE_NAME}" TARGET_FILE="dist/${ARCH}/${FILE_NAME}" - if [[ -f "$TARGET_FILE" ]]; then - echo "✅ File already exists: $TARGET_FILE (Skipping)" - else - echo "⬇️ Downloading: $FILE_URL" - wget -q "$FILE_URL" -O "$TARGET_FILE" - fi + if [[ -f "$TARGET_FILE" ]]; then + echo "✅ File already exists: $TARGET_FILE (Skipping)" + else + echo "⬇️ Downloading: $FILE_URL" + wget -q "$FILE_URL" -O "$TARGET_FILE" + fi done done # Verify GPG Signatures for ARCH in "${ARCHS[@]}"; do - echo "Verifying GPG signature for ${ARCH}..." + echo "Verifying GPG signature for ${ARCH} …" gpg --verify "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz.asc" "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz" gpg --verify "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz.sha256.asc" "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz.sha256" done @@ -44,7 +44,7 @@ done # Verify Checksums for ARCH in "${ARCHS[@]}"; do - echo "Verifying SHA256 checksum for ${ARCH}..." + echo "Verifying SHA256 checksum for ${ARCH} …" (cd "dist/${ARCH}" && sha256sum -c gitea-${VERSION}-linux-${ARCH}.xz.sha256) done @@ -66,7 +66,7 @@ done # Build Debian Packages for ARCH in "${ARCHS[@]}"; do - echo "Building package for ${ARCH}..." + echo "Building package for ${ARCH} …" sed -i "s/^Version: .*/Version: ${VERSION}/" "${ARCH}/DEBIAN/control" dpkg-deb --build "${ARCH}" "gitea_${VERSION}_${ARCH}.deb" done @@ -74,26 +74,26 @@ done echo "All packages built successfully:" ls -lh gitea_${VERSION}_*.deb -echo "Moving .deb packages to release repo..." +echo "Moving .deb packages to release repo …" mv gitea_${VERSION}_*.deb ../gitea-deb/ -cd ../gitea-deb +( + cd ../gitea-deb -echo "Updating APT package index..." -dpkg-scanpackages --multiversion . override > Packages -dpkg-scanpackages --multiversion . override | gzip -9c > Packages.gz + echo "Updating APT package index …" + dpkg-scanpackages --multiversion . override > Packages + dpkg-scanpackages --multiversion . override | gzip -9c > Packages.gz -echo "Generating Release file..." -apt-ftparchive -c=apt-release.conf release . > Release + echo "Generating Release file …" + apt-ftparchive -c=apt-release.conf release . > Release -git add --all . -if ! git diff --cached --quiet; then - echo "Committing and pushing release..." - git commit -m "Release Gitea ${VERSION}" - git push -else - echo "No changes to commit." -fi - -cd ../gitea-deb-builder + git add --all . + if ! git diff --cached --quiet; then + echo "Committing and pushing release …" + git commit -m "Release Gitea ${VERSION}" + git push + else + echo "No changes to commit." + fi +)