From 6e582dafc432696b3a5c0639946e4c7d3300195d Mon Sep 17 00:00:00 2001 From: fithwum Date: Wed, 9 Jul 2025 06:25:06 -0700 Subject: [PATCH] fhdfhdfghf --- .gitea/workflows/base-build.yml | 43 +++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index ecde236..bd497b6 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -24,7 +24,7 @@ env: jobs: build-and-push-rootfs-archives: - runs-on: docker-build + runs-on: vm1-docker-build2 outputs: archives_changed: ${{ steps.commit_archives.outputs.archives_changed }} steps: @@ -124,6 +124,31 @@ jobs: - name: Checkout source uses: actions/checkout@v3 + - name: Wait for archives to appear in upload repo + run: | + echo "[INFO] Waiting for archives to appear in upload-repo..." + + GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}" + git clone "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo + + for version in $VERSIONS; do + for i in {1..10}; do + if [[ -f "temp-check/$version/debian-$version.tar.bz2" ]]; then + echo "[OK] Found archive for $version" + break + else + echo "[WAIT] $version not ready yet, sleeping 10s..." + sleep 10 + git -C temp-check pull --rebase --quiet + fi + + if [[ $i -eq 10 ]]; then + echo "[ERROR] Archive $version did not appear in time." + exit 1 + fi + done + done + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -150,7 +175,9 @@ jobs: uses: actions/checkout@v3 - name: Clone upload repo - run: git clone https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git upload-repo + run: | + GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}" + git clone "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo - name: Generate per-version changelogs run: | @@ -169,11 +196,12 @@ jobs: fi echo -e "\n## $(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$changelog" - if [ -n "$last_commit" ]; then - git log "${last_commit}..HEAD" --pretty=format:"- %s (%an)" | head -n 10 >> "$changelog" + + if [ -n "$last_commit" ] && git rev-parse --quiet --verify "$last_commit^{commit}" >/dev/null; then + git log "${last_commit}..HEAD" --pretty=format:"- %s (%an)" | head -n 10 || true else - git log -n 10 --pretty=format:"- %s (%an)" >> "$changelog" - fi + git log -n 10 --pretty=format:"- %s (%an)" || true + fi >> "$changelog" done - name: Commit and push changelogs if changed @@ -199,7 +227,8 @@ jobs: - name: Clone upload repo run: | - git clone "https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo + GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}" + git clone "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo - name: Copy checksum file into workspace run: |