π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
π· Streamlined auto-tagging
Alicia Sykes0cabd9be8f18
diff --git a/.github/workflows/manual-tag.yml b/.github/workflows/manual-tag.ymldeleted file mode 100644index 85cf5ff0..00000000--- a/.github/workflows/manual-tag.yml+++ /dev/null@@ -1,66 +0,0 @@-# Manual fallback for creating a tag with optional version bump.-# The automated flow is handled by bump-and-tag.yml on PR merge.-name: π·οΈ Tag on Version Change--on:- workflow_dispatch:- inputs:- version:- description: 'Version to tag (e.g. 3.2.0). Leave empty to auto-bump patch.'- required: false--concurrency:- group: manual-tag-version- cancel-in-progress: false--jobs:- tag-version:- runs-on: ubuntu-latest-- steps:- - name: Check Out Repository ποΈ- uses: actions/checkout@v6- with:- token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}- fetch-depth: 0-- - name: Configure Git Identity π€- run: |- git config user.name "Liss-Bot"- git config user.email "[email protected]"-- - name: Determine and Apply Version π’- id: version- env:- INPUT_VERSION: ${{ github.event.inputs.version }}- run: |- CURRENT=$(node -p "require('./package.json').version")- if [ -n "$INPUT_VERSION" ]; then- TARGET="${INPUT_VERSION#v}"- else- npm version patch --no-git-tag-version > /dev/null- TARGET=$(node -p "require('./package.json').version")- fi- if [ "$TARGET" != "$CURRENT" ]; then- npm version "$TARGET" --no-git-tag-version --allow-same-version- git add package.json- git commit -m "π Bump version to $TARGET [skip ci]"- git push- echo "Committed version bump to $TARGET"- else- echo "package.json already at $CURRENT, skipping commit"- fi- echo "TARGET=$TARGET" >> $GITHUB_OUTPUT-- - name: Create and Push Tag ‴οΈ- env:- TAG: ${{ steps.version.outputs.TARGET }}- run: |- git fetch --tags --force- if git rev-parse "refs/tags/$TAG" >/dev/null 2>&1; then- echo "Tag $TAG already exists, skipping"- else- git tag -a "$TAG" -m "Release v$TAG"- git push origin "$TAG"- echo "Created and pushed tag $TAG"- fidiff --git a/.github/workflows/bump-and-tag.yml b/.github/workflows/tag.ymlsimilarity index 67%rename from .github/workflows/bump-and-tag.ymlrename to .github/workflows/tag.ymlindex 4378d6aa..377b63fb 100644--- a/.github/workflows/bump-and-tag.yml+++ b/.github/workflows/tag.yml@@ -1,17 +1,29 @@-# Creates a new git tag when a PR is merged+# Creates a new git tag when a PR is merged, or on manual dispatch#-# Here's the flow:+# PR trigger flow:# - Triggered whenever a PR is merged, if that PR made code changes# - If version wasn't bumped in PR, increment patch version and update package.json# - Otherwise (if the PR did bump version) we use the new version from package.json# - Creates and pushes a git tag for the new version# - That git tag then triggers Docker publishing and release drafting in other CI-# - Add tags to issues from newly relesaed features/fixes (if applicable)+# - Add labels and release comments to referenced issues (if applicable)# - Trigger fresh deploy of docs site, so changelog remains up-to-date# - Finally, shows summary of actions taken and new tag published+#+# Manual dispatch flow:+# - If a version is provided, sets package.json to that version+# - If no version is provided, increments patch version automatically+# - Creates and pushes a git tag, then triggers docs site rebuild+name: π Auto Version & Tagon:+ workflow_dispatch:+ inputs:+ version:+ description: 'Version to tag (e.g. 4.1.0). Leave blank to auto-increment patch.'+ required: false+ type: stringpull_request_target:types: [closed]branches: [master]@@ -25,14 +37,37 @@ permissions:pull-requests: readissues: write+env:+ IS_MANUAL: ${{ github.event_name == 'workflow_dispatch' }}+jobs:version-and-tag:- if: github.event.pull_request.merged == true+ if: >-+ github.event_name == 'workflow_dispatch'+ || github.event.pull_request.merged == trueruns-on: ubuntu-latest+ timeout-minutes: 15steps:- - name: Check PR for code changes and version bump π+ - name: π’ Validate manual dispatch+ if: env.IS_MANUAL == 'true'+ env:+ INPUT_VERSION: ${{ inputs.version }}+ DISPATCH_REF: ${{ github.ref }}+ run: |+ set -euo pipefail+ if [ "$DISPATCH_REF" != "refs/heads/master" ]; then+ echo "::error::Manual dispatch only allowed from master (got: $DISPATCH_REF)"+ exit 1+ fi+ if [ -n "$INPUT_VERSION" ] && ! printf '%s' "$INPUT_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then+ echo "::error::Invalid version '${INPUT_VERSION}'. Must be semver (e.g. 4.1.0)."+ exit 1+ fi++ - name: π Check PR for code changes and version bumpid: check_pr+ if: env.IS_MANUAL != 'true'uses: actions/github-script@v8with:script: |@@ -43,7 +78,7 @@ jobs:github.rest.pulls.listFiles, { owner, repo, pull_number });const codePatterns = [- /^src\//, /^services\//, /^public\//, /^Dockerfile$/, /^[^/]+\.js$/,+ /^src\//, /^services\//, /^public\//, /^Dockerfile$/, /^yarn.lock$/, /^[^/]+\.js$/,];const codeChanged = files.some(f =>codePatterns.some(p => p.test(f.filename))@@ -83,21 +118,21 @@ jobs:core.setOutput('needs_bump', needsBump.toString());core.setOutput('needs_tag', needsTag.toString());- - name: Checkout repository ποΈ- if: steps.check_pr.outputs.needs_tag == 'true'+ - name: ποΈ Checkout repository+ if: env.IS_MANUAL == 'true' || steps.check_pr.outputs.needs_tag == 'true'uses: actions/checkout@v6with:token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}- - name: Configure git identity π€- if: steps.check_pr.outputs.needs_tag == 'true'+ - name: π€ Configure git identity+ if: env.IS_MANUAL == 'true' || steps.check_pr.outputs.needs_tag == 'true'run: |git config user.name "Liss-Bot"git config user.email "[email protected]"- - name: Extract referenced issues π+ - name: π Extract referenced issuesid: issues- if: steps.check_pr.outputs.needs_tag == 'true'+ if: env.IS_MANUAL != 'true' && steps.check_pr.outputs.needs_tag == 'true'uses: actions/github-script@v8with:script: |@@ -119,47 +154,76 @@ jobs:core.info(`Found issue references: ${unique.join(', ')}`);core.setOutput('numbers', unique.join(','));- - name: Bump patch version β¬οΈ- if: steps.check_pr.outputs.needs_bump == 'true'+ - name: β¬οΈ Bump version+ id: bump+ if: >-+ env.IS_MANUAL == 'true'+ || steps.check_pr.outputs.needs_bump == 'true'+ env:+ INPUT_VERSION: ${{ inputs.version }}run: |- npm version patch --no-git-tag-version+ set -euo pipefail+ if [ "$IS_MANUAL" = "true" ] && [ -n "$INPUT_VERSION" ]; then+ npm version "$INPUT_VERSION" --no-git-tag-version --allow-same-version+ else+ npm version patch --no-git-tag-version+ fi+ NEW_VERSION=$(node -p "require('./package.json').version")git add package.json- git commit -m "π Bump version to $(node -p "require('./package.json').version")"- git push+ if git diff --cached --quiet; then+ echo "package.json already at $NEW_VERSION, nothing to commit"+ echo "bumped=false" >> "$GITHUB_OUTPUT"+ else+ git commit -m "π Bump version to $NEW_VERSION"+ git push+ echo "bumped=true" >> "$GITHUB_OUTPUT"+ fi- - name: Create and push tag π·οΈ+ - name: π·οΈ Create and push tagid: tag- if: steps.check_pr.outputs.needs_tag == 'true'+ if: env.IS_MANUAL == 'true' || steps.check_pr.outputs.needs_tag == 'true'env:- PR_NUMBER: ${{ github.event.pull_request.number }}- PR_TITLE: ${{ github.event.pull_request.title }}- PR_AUTHOR: ${{ github.event.pull_request.user.login }}- MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}+ PR_NUMBER: ${{ github.event.pull_request.number || '' }}+ PR_TITLE: ${{ github.event.pull_request.title || '' }}+ PR_AUTHOR: ${{ github.event.pull_request.user.login || github.actor }}+ MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha || github.sha }}ISSUES: ${{ steps.issues.outputs.numbers }}run: |+ set -euo pipefailVERSION=$(node -p "require('./package.json').version")git fetch --tags --forceif git rev-parse "refs/tags/$VERSION" >/dev/null 2>&1; thenecho "Tag $VERSION already exists, skipping"+ echo "result=existed" >> "$GITHUB_OUTPUT"+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"exit 0fi{printf 'Dashy v%s π\n\n' "$VERSION"- printf 'PR: #%s - %s\n' "$PR_NUMBER" "$PR_TITLE"+ if [ -n "$PR_NUMBER" ]; then+ printf 'PR: #%s - %s\n' "$PR_NUMBER" "$PR_TITLE"+ else+ printf 'Manual release by @%s\n' "$PR_AUTHOR"+ fiif [ -n "$ISSUES" ]; thenprintf 'Resolves: %s\n' "$(echo "$ISSUES" | sed 's/,/, #/g; s/^/#/')"fiprintf 'Author: @%s\n' "$PR_AUTHOR"- printf 'Merge commit: %s\n' "$MERGE_SHA"+ printf 'Commit: %s\n' "$MERGE_SHA"} > tag-message.txtgit tag -a "$VERSION" -F tag-message.txtgit push origin "$VERSION"+ echo "result=created" >> "$GITHUB_OUTPUT"+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"- - name: Label referenced issues π©οΈ+ - name: π©οΈ Label referenced issuesid: label- if: steps.check_pr.outputs.needs_tag == 'true' && steps.issues.outputs.numbers != ''+ if: >-+ env.IS_MANUAL != 'true'+ && steps.check_pr.outputs.needs_tag == 'true'+ && steps.issues.outputs.numbers != ''continue-on-error: trueuses: actions/github-script@v8env:@@ -234,53 +298,65 @@ jobs:}}- - name: Trigger docs site rebuild π+ - name: π Trigger docs site rebuildid: docs- if: steps.tag.outcome == 'success'+ if: steps.tag.outputs.result == 'created'continue-on-error: trueenv:HOOK_URL: ${{ secrets.DOCS_SITE_REBUILD_HOOK }}+ VERSION: ${{ steps.tag.outputs.version }}run: |+ set -euo pipefailif [ -z "$HOOK_URL" ]; thenecho "::warning::DOCS_SITE_REBUILD_HOOK secret is not set, skipping"exit 1fi- VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "unknown")curl -sf -X POST -d '{}' "${HOOK_URL}?trigger_title=v${VERSION}+released" \--max-time 15 --retry 2 --retry-max-time 30echo "Triggered docs rebuild for v${VERSION}"- - name: Job summary π+ - name: π Job summaryif: always()env:- PR_NUMBER: ${{ github.event.pull_request.number }}- PR_TITLE: ${{ github.event.pull_request.title }}+ PR_NUMBER: ${{ github.event.pull_request.number || '' }}+ PR_TITLE: ${{ github.event.pull_request.title || '' }}REPO_URL: ${{ github.server_url }}/${{ github.repository }}NEEDS_BUMP: ${{ steps.check_pr.outputs.needs_bump }}NEEDS_TAG: ${{ steps.check_pr.outputs.needs_tag }}ISSUES: ${{ steps.issues.outputs.numbers }}+ BUMPED: ${{ steps.bump.outputs.bumped }}TAG_OUTCOME: ${{ steps.tag.outcome }}+ TAG_RESULT: ${{ steps.tag.outputs.result }}+ TAG_VERSION: ${{ steps.tag.outputs.version }}LABEL_OUTCOME: ${{ steps.label.outcome }}DOCS_OUTCOME: ${{ steps.docs.outcome }}run: |- VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "unknown")+ set -euo pipefail+ VERSION="${TAG_VERSION:-$(node -p "require('./package.json').version" 2>/dev/null || echo "unknown")}"{echo "## π Auto Version & Tag"echo ""echo "| Step | Result |"echo "|------|--------|"- echo "| PR | [#${PR_NUMBER}](${REPO_URL}/pull/${PR_NUMBER}) β ${PR_TITLE} |"- if [ "$NEEDS_BUMP" = "true" ]; then+ if [ "$IS_MANUAL" = "true" ]; then+ echo "| Trigger | Manual dispatch |"+ elif [ -n "$PR_NUMBER" ]; then+ echo "| PR | [#${PR_NUMBER}](${REPO_URL}/pull/${PR_NUMBER}) β ${PR_TITLE} |"+ fi++ if [ "$BUMPED" = "true" ]; thenecho "| Version bump | β \`${VERSION}\` |"elseecho "| Version bump | βοΈ Skipped |"fi- if [ "$NEEDS_TAG" = "true" ] && [ "$TAG_OUTCOME" = "success" ]; then+ if [ "$TAG_RESULT" = "created" ]; thenecho "| Tag | β [\`${VERSION}\`](${REPO_URL}/releases/tag/${VERSION}) |"- elif [ "$NEEDS_TAG" = "true" ]; then+ elif [ "$TAG_RESULT" = "existed" ]; then+ echo "| Tag | βοΈ Already exists: \`${VERSION}\` |"+ elif [ "$TAG_OUTCOME" = "failure" ]; thenecho "| Tag | β Failed |"elseecho "| Tag | βοΈ Skipped |"