test
All checks were successful
Build and Push Minecraft Docker Images on Debian-base update / poll-debian-base-and-detect-changes (push) Successful in 9s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing (push) Successful in 10s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push fabric (push) Successful in 10s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push vanilla (push) Successful in 10s
Build and Push Minecraft Docker Images on Debian-base update / generate-changelogs (push) Successful in 5s
Build and Push Minecraft Docker Images on Debian-base update / generate-build-info (push) Successful in 7s
All checks were successful
Build and Push Minecraft Docker Images on Debian-base update / poll-debian-base-and-detect-changes (push) Successful in 9s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing (push) Successful in 10s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push fabric (push) Successful in 10s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push vanilla (push) Successful in 10s
Build and Push Minecraft Docker Images on Debian-base update / generate-changelogs (push) Successful in 5s
Build and Push Minecraft Docker Images on Debian-base update / generate-build-info (push) Successful in 7s
This commit is contained in:
@@ -118,99 +118,82 @@ jobs:
|
||||
generate-changelogs:
|
||||
needs: build-minecraft-images
|
||||
runs-on: doc-docker-build2
|
||||
strategy:
|
||||
matrix:
|
||||
version: [vanilla, testing, fabric]
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Clone Minecraft repo (with retries)
|
||||
- name: Create temporary changelog workspace
|
||||
run: mkdir -p changelogs
|
||||
|
||||
- name: Clone Minecraft repo
|
||||
run: |
|
||||
GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}"
|
||||
for i in {1..5}; do
|
||||
git clone "https://${{ secrets.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/minecraft.git" upload-repo && break
|
||||
echo "[WARN] Clone attempt $i failed. Retrying in 10s..."
|
||||
sleep 10
|
||||
done
|
||||
if [ ! -d upload-repo ]; then
|
||||
echo "[ERROR] Failed to clone Minecraft repo after retries."
|
||||
exit 1
|
||||
fi
|
||||
git clone --depth=3 "https://${{ secrets.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/minecraft.git" upload-repo
|
||||
|
||||
- name: Generate changelog
|
||||
- name: Generate changelogs
|
||||
run: |
|
||||
cd upload-repo
|
||||
changelog="${{ matrix.version }}/CHANGES.md"
|
||||
for version in $VERSIONS; do
|
||||
echo "[INFO] Generating changelog for $version"
|
||||
changelog="changelogs/$version/CHANGES.md"
|
||||
mkdir -p "$(dirname "$changelog")"
|
||||
touch "$changelog"
|
||||
|
||||
infofile="${{ matrix.version }}/build-info.json"
|
||||
cd upload-repo
|
||||
infofile="$version/build-info.json"
|
||||
last_commit=""
|
||||
if [ -f "$infofile" ]; then
|
||||
last_commit=$(jq -r '.commit' "$infofile")
|
||||
fi
|
||||
|
||||
echo -e "## $(date -u +'%Y-%m-%dT%H:%M:%SZ')\n" >> "$changelog"
|
||||
|
||||
echo -e "## $(date -u +'%Y-%m-%dT%H:%M:%SZ')\n" > "../$changelog"
|
||||
if [ -n "$last_commit" ]; then
|
||||
COMMITS=$(git log "${last_commit}..HEAD" --pretty=format:"- %s (%an)" || true)
|
||||
fi
|
||||
|
||||
if [ -z "$COMMITS" ]; then
|
||||
echo "[INFO] No new commits since last build. Showing latest 5 instead."
|
||||
COMMITS=$(git log -n 5 --pretty=format:"- %s (%an)" || true)
|
||||
fi
|
||||
echo "$COMMITS" >> "../$changelog"
|
||||
cd ..
|
||||
done
|
||||
|
||||
echo "$COMMITS" >> "$changelog"
|
||||
|
||||
- name: Show git status (debug)
|
||||
- name: Copy changelogs into repo
|
||||
run: |
|
||||
cd upload-repo
|
||||
echo "[DEBUG] Git status before commit:"
|
||||
git status
|
||||
echo "[DEBUG] Git diff:"
|
||||
git diff
|
||||
for version in $VERSIONS; do
|
||||
mkdir -p upload-repo/$version
|
||||
cp changelogs/$version/CHANGES.md upload-repo/$version/
|
||||
done
|
||||
|
||||
- name: Commit and push changelog
|
||||
- name: Commit and push changelogs
|
||||
run: |
|
||||
cd upload-repo
|
||||
git config user.name "${{ secrets.GIT_USERNAME }}"
|
||||
git config user.email "${{ secrets.GIT_EMAIL }}"
|
||||
|
||||
if git status --porcelain | grep .; then
|
||||
git add "${{ matrix.version }}/CHANGES.md"
|
||||
git commit -m "Update changelog for ${{ matrix.version }}" || true
|
||||
git add */CHANGES.md
|
||||
git commit -m "Update changelogs on $(date -u +'%Y-%m-%dT%H:%M:%SZ')" --no-verify
|
||||
git push
|
||||
else
|
||||
echo "[INFO] No changelog changes to commit."
|
||||
fi
|
||||
|
||||
generate-build-info:
|
||||
needs: build-minecraft-images
|
||||
needs: generate-changelogs
|
||||
runs-on: doc-docker-build2
|
||||
strategy:
|
||||
matrix:
|
||||
version: [vanilla, testing, fabric]
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Clone Minecraft repo (with retries)
|
||||
- name: Prepare temporary build-info workspace
|
||||
run: mkdir -p buildinfo
|
||||
|
||||
- name: Clone Minecraft repo
|
||||
run: |
|
||||
GIT_CREDENTIAL="${{ secrets.GIT_TOKEN || secrets.GIT_PASSWORD }}"
|
||||
for i in {1..5}; do
|
||||
git clone "https://${{ secrets.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/minecraft.git" upload-repo && break
|
||||
echo "[WARN] Clone attempt $i failed. Retrying in 10s..."
|
||||
sleep 10
|
||||
done
|
||||
if [ ! -d upload-repo ]; then
|
||||
echo "[ERROR] Failed to clone Minecraft repo after retries."
|
||||
exit 1
|
||||
fi
|
||||
git clone --depth=1 "https://${{ secrets.GIT_USERNAME }}:${GIT_CREDENTIAL}@gitea.fithwum.tech/fithwum/minecraft.git" upload-repo
|
||||
|
||||
- name: Generate build-info.json
|
||||
- name: Generate build-info files
|
||||
run: |
|
||||
human_size() {
|
||||
local b=$1 d='' s=0 S=(B KB MB GB TB)
|
||||
@@ -220,10 +203,11 @@ jobs:
|
||||
printf "%s%s\n" "$b" "${S[$s]}"
|
||||
}
|
||||
|
||||
cd upload-repo
|
||||
mkdir -p "${{ matrix.version }}"
|
||||
infofile="${{ matrix.version }}/build-info.json"
|
||||
image="${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_ORG }}/${{ env.IMAGE_REPO_MINECRAFT }}:${{ matrix.version }}"
|
||||
for version in $VERSIONS; do
|
||||
echo "[INFO] Generating build-info.json for $version"
|
||||
image="${IMAGE_REGISTRY}/${IMAGE_ORG}/${IMAGE_REPO_MINECRAFT}:$version"
|
||||
infofile="buildinfo/$version/build-info.json"
|
||||
mkdir -p "$(dirname "$infofile")"
|
||||
|
||||
if ! docker pull "$image"; then
|
||||
echo "[WARN] Failed to pull $image — setting fields to unknown/0"
|
||||
@@ -238,9 +222,13 @@ jobs:
|
||||
|
||||
size_human=$(human_size "$size_bytes")
|
||||
|
||||
cd upload-repo
|
||||
commit=$(git rev-parse HEAD)
|
||||
cd ..
|
||||
|
||||
jq -n \
|
||||
--arg version "${{ matrix.version }}" \
|
||||
--arg commit "$(git rev-parse HEAD)" \
|
||||
--arg version "$version" \
|
||||
--arg commit "$commit" \
|
||||
--arg build_time "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||
--arg image_tag "$image" \
|
||||
--arg digest "$digest" \
|
||||
@@ -255,17 +243,14 @@ jobs:
|
||||
image_size: $image_size,
|
||||
image_size_bytes: $image_size_bytes
|
||||
}' > "$infofile"
|
||||
done
|
||||
|
||||
echo "[INFO] Generated $infofile:"
|
||||
cat "$infofile"
|
||||
|
||||
- name: Git status debug
|
||||
- name: Copy build-info.json into repo
|
||||
run: |
|
||||
cd upload-repo
|
||||
echo "[DEBUG] Git status before commit:"
|
||||
git status
|
||||
echo "[DEBUG] Git diff:"
|
||||
git diff "${{ matrix.version }}/build-info.json" || true
|
||||
for version in $VERSIONS; do
|
||||
mkdir -p upload-repo/$version
|
||||
cp "buildinfo/$version/build-info.json" "upload-repo/$version/"
|
||||
done
|
||||
|
||||
- name: Commit and push build-info
|
||||
run: |
|
||||
@@ -274,14 +259,16 @@ jobs:
|
||||
git config user.email "${{ secrets.GIT_EMAIL }}"
|
||||
|
||||
if git status --porcelain | grep .; then
|
||||
git add "${{ matrix.version }}/build-info.json"
|
||||
git commit -m "Update build-info for ${{ matrix.version }} on $(date -u +'%Y-%m-%dT%H:%M:%SZ')" || true
|
||||
git add */build-info.json
|
||||
git commit -m "Update build-info on $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||
git push
|
||||
|
||||
TAG="build-${{ matrix.version }}"
|
||||
for version in $VERSIONS; do
|
||||
TAG="build-$version"
|
||||
git tag -d "$TAG" 2>/dev/null || true
|
||||
git tag "$TAG"
|
||||
git push origin "$TAG" --force
|
||||
done
|
||||
else
|
||||
echo "[INFO] No build-info changes to commit."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user