Files
BetterDesk/.github/workflows/version-bump-dev.yml
T
UNITRONIX 817189e39e fix(ci): dispatch GHCR :dev publish after version bump
GITHUB_TOKEN bump pushes never start other workflows, so inverting the
docker build trigger alone left :dev unpublished. version-bump-dev now
dispatches docker-publish with tag=dev after a successful bump.

Refs #401

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow)
2026-09-03 21:39:01 +02:00

84 lines
3.0 KiB
YAML

# =============================================================================
# BetterDesk — automatic patch version bump on dev branch
# =============================================================================
# Every push to dev (except version-bump commits) bumps product version +0.0.1
# across Tier 1/2 files via scripts/bump-version.js.
#
# After a successful bump push, explicitly dispatch docker-publish (tag=dev).
# GITHUB_TOKEN branch pushes do not re-trigger other workflows, so relying on
# the bump commit alone would never republish GHCR :dev (#401).
# =============================================================================
name: Version Bump (dev)
on:
push:
branches: [dev]
permissions:
contents: write
actions: write
concurrency:
group: version-bump-dev
cancel-in-progress: false
jobs:
bump-patch:
# Skip only real auto-bump commits (subject line), not feature messages that
# happen to mention the marker in the body.
if: |
!startsWith(github.event.head_commit.message, 'chore: bump version') &&
!startsWith(github.event.head_commit.message, 'chore: release version')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '24'
- name: Bump patch version
id: bump
run: |
node scripts/bump-version.js --patch
NEW_VERSION=$(cat VERSION | tr -d '\n')
echo "version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
- name: Commit and push version bump
id: commit
env:
NEW_VERSION: ${{ steps.bump.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add $(node scripts/bump-version.js --list-paths)
if git diff --cached --quiet; then
echo "No version files changed — skipping commit"
echo "pushed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
git commit -m "chore: bump version to ${NEW_VERSION} [version-bump]"
for attempt in 1 2 3 4 5; do
if git push; then
echo "pushed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Push failed (attempt ${attempt}/5) — rebasing and retrying..."
git pull --rebase origin dev
done
echo "Version bump push failed after retries"
exit 1
- name: Trigger GHCR :dev image publish
if: steps.commit.outputs.pushed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Explicit dispatch — bump commits from GITHUB_TOKEN do not start workflows.
gh workflow run "Build & Publish Docker Images" --ref dev -f tag=dev
echo "Dispatched docker-publish for :dev (VERSION ${{ steps.bump.outputs.version }})"