From 3a146dcba7425482c70fc4ac7d5bbf0e2effbb45 Mon Sep 17 00:00:00 2001 From: fithwum Date: Sat, 20 Dec 2025 14:47:47 -0800 Subject: [PATCH] fgsdfgsdfgdsfg --- .gitea/workflows/base-build.yml | 64 +++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index da9d7fc..f9f986c 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -134,7 +134,7 @@ jobs: # fi build-and-push-rootfs-archives: - name: Build rootfs (${{ matrix.version }}) + name: Build RootFS Archives (${{ matrix.version }}) runs-on: vm-docker-build2 needs: docker-prune strategy: @@ -142,59 +142,69 @@ jobs: matrix: version: [bullseye, bookworm, trixie] steps: - - uses: actions/checkout@v3 + - name: Checkout source + uses: actions/checkout@v3 - - name: Build rootfs image + - name: Create output directory for version + run: mkdir -p ./output/${{ matrix.version }} + + - name: Build rootfs Docker image run: | - docker build \ - --build-arg VERSION=${{ matrix.version }} \ - -t rootfs-${{ matrix.version }} . + VERSION=${{ matrix.version }} + docker build --build-arg VERSION="$VERSION" -t rootfs-$VERSION . - name: Run rootfs bootstrap run: | VERSION=${{ matrix.version }} + OUTPUT_DIR=./output/$VERSION - mkdir -p output docker run --rm --privileged \ - -v "$(pwd)/output:/output" \ + -v "$PWD/$OUTPUT_DIR:/output" \ + -e VERSION="$VERSION" \ rootfs-$VERSION \ - bash -c "/scripts/bootstrap-rootfs.sh $VERSION" + bash -c "/scripts/bootstrap-rootfs.sh $VERSION /output" - if [[ ! -f "output/debian-$VERSION.tar.bz2" ]]; then - echo "[ERROR] output/debian-$VERSION.tar.bz2 missing" - ls -lh output || true + TAR="$OUTPUT_DIR/debian-$VERSION.tar.bz2" + if [[ ! -f "$TAR" ]]; then + echo "[ERROR] Rootfs tarball missing: $TAR" + ls -lh "$OUTPUT_DIR" exit 1 + else + echo "[OK] Created $TAR" fi - name: Clone upload repo run: | - git clone --depth=1 \ - https://${GIT_USERNAME}:${GIT_TOKEN}@gitea.fithwum.tech/fithwum/debian-base.git upload + GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}" + git clone --depth=1 "https://${{ env.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/debian-base.git" upload-repo - - name: Update archive + sha256 + - name: Copy new archive into upload repo run: | VERSION=${{ matrix.version }} + mkdir -p "upload-repo/$VERSION" + cp "./output/$VERSION/debian-$VERSION.tar.bz2" "upload-repo/$VERSION/" - mkdir -p upload/$VERSION - cp "output/debian-$VERSION.tar.bz2" "upload/$VERSION/" - - cd upload - sed -i "/debian-$VERSION.tar.bz2/d" sha256sums.txt 2>/dev/null || true + - name: Update sha256sums + run: | + cd upload-repo + sed -i "/debian-${{ matrix.version }}.tar.bz2/d" sha256sums.txt 2>/dev/null || true sha256sum "$VERSION/debian-$VERSION.tar.bz2" >> sha256sums.txt - name: Commit and push if changed + id: commit_archives run: | - cd upload - git config user.name "$GIT_USERNAME" - git config user.email "$GIT_EMAIL" + cd upload-repo + git config --global user.name "${{ env.GIT_USERNAME }}" + git config --global user.email "${{ env.GIT_EMAIL }}" if git status --porcelain | grep .; then - git add "$VERSION/debian-$VERSION.tar.bz2" sha256sums.txt - git commit -m "Update rootfs for $VERSION [skip ci]" + git add **/*.tar.bz2 sha256sums.txt + git commit -m "Update base images and checksum for ${{ matrix.version }} on $(date -u +'%Y-%m-%dT%H:%M:%SZ') [skip ci]" git push + echo "archives_changed=true" >> $GITEA_OUTPUT else - echo "[INFO] No changes for $VERSION" - fi + echo "[INFO] No changes to commit." + echo "archives_changed=false" >> $GITEA_OUTPUT # build-and-push-docker-images: # needs: