From e71877adaad55ad0a61de5a3a28ebf5010277e2c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:50:23 +0000 Subject: [PATCH 1/3] Initial plan From 56d766b5b769a8906b91e8549a766d09dc9890fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:54:53 +0000 Subject: [PATCH 2/3] build: auto-bump version in VERSION and README.md during CI build Agent-Logs-Url: https://github.com/tikoci/make.d/sessions/6c70a7f7-fb28-494c-973d-f8d09c7ff53d Co-authored-by: mobileskyfi <45924209+mobileskyfi@users.noreply.github.com> --- .github/workflows/build.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d0e3d0b..55074c8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,7 +12,7 @@ env: permissions: packages: write - contents: read + contents: write jobs: build: @@ -39,6 +39,26 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Bump patch version in VERSION and README.md + run: | + read -r name ver channel < VERSION || true + IFS='.' read -r major minor patch <<< "$ver" + patch=$((patch + 1)) + new_ver="${major}.${minor}.${patch}" + echo "${name} ${new_ver} ${channel}" > VERSION + sed -i "s/> ${name} ${ver} ${channel}/> ${name} ${new_ver} ${channel}/" README.md + - name: Commit updated version + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add VERSION README.md + if git diff --cached --quiet; then + echo "No version changes to commit" + else + git commit -m "build: bump version to $(awk '{print $2}' VERSION)" + git pull --rebase + git push + fi - name: VERSION file to CI envvars run: | cat VERSION | awk '{ print "MAKED_NAME=" $1 }' >> $GITHUB_ENV From 17b4521630092143ee5a40134c02626fb6e696a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 21:12:25 +0000 Subject: [PATCH 3/3] fix: address code review feedback on version bump workflow Agent-Logs-Url: https://github.com/tikoci/make.d/sessions/71b1a2b1-1f21-420f-8118-b78436b27d30 Co-authored-by: mobileskyfi <45924209+mobileskyfi@users.noreply.github.com> --- .github/workflows/build.yaml | 38 +++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 55074c8..833fb52 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + fetch-depth: 0 - name: Set up QEMU need for cross-platform building uses: docker/setup-qemu-action@v3 with: @@ -41,12 +44,42 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Bump patch version in VERSION and README.md run: | + # read returns non-zero when file lacks trailing newline, so check content instead read -r name ver channel < VERSION || true + + if [ -z "$name" ] || [ -z "$ver" ] || [ -z "$channel" ]; then + echo "Error: VERSION must be in the format: " >&2 + echo "Got: name='${name}', ver='${ver}', channel='${channel}'" >&2 + exit 1 + fi + + if ! [[ "$ver" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: version '${ver}' is not a valid semantic version (expected major.minor.patch)" >&2 + exit 1 + fi + IFS='.' read -r major minor patch <<< "$ver" + if [ -z "$major" ] || [ -z "$minor" ] || [ -z "$patch" ]; then + echo "Error: failed to parse version components from '${ver}'" >&2 + exit 1 + fi patch=$((patch + 1)) new_ver="${major}.${minor}.${patch}" echo "${name} ${new_ver} ${channel}" > VERSION - sed -i "s/> ${name} ${ver} ${channel}/> ${name} ${new_ver} ${channel}/" README.md + old="> ${name} ${ver} ${channel}" + new="> ${name} ${new_ver} ${channel}" + python3 - "$old" "$new" << 'PY' +import sys +from pathlib import Path + +old, new = sys.argv[1], sys.argv[2] +path = Path("README.md") +text = path.read_text(encoding="utf-8") +if old not in text: + raise SystemExit(f"Old version string not found in README.md: {old!r}") +text = text.replace(old, new, 1) +path.write_text(text, encoding="utf-8") +PY - name: Commit updated version run: | git config user.name "github-actions[bot]" @@ -56,8 +89,7 @@ jobs: echo "No version changes to commit" else git commit -m "build: bump version to $(awk '{print $2}' VERSION)" - git pull --rebase - git push + git push origin HEAD:${{ github.ref }} fi - name: VERSION file to CI envvars run: |