-
-
Notifications
You must be signed in to change notification settings - Fork 887
Auto versioning #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Auto versioning #1344
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1f81dd2
feat: implement version bumping script and pre-push hook
Azgaar 87a9d7c
chore: bump version to 1.113.5
Azgaar d92aab8
chore: bump version to 1.113.6
Azgaar a7ad705
chore: bump version to 1.113.7
Azgaar 0889fd7
chore: bump version to 1.113.8
Azgaar a8d27c1
chore: bump version to 1.113.9
Azgaar bbd3a90
chore: bump version to 1.113.10
Azgaar 274e992
chore: bump version to 1.113.3 and update versioning process
Azgaar 71ad41b
chore: enhance version bump process with base version check
Azgaar f43fd9a
Update .github/workflows/bump-version.yml
Azgaar 2eeb016
Update .github/workflows/bump-version.yml
Azgaar 7b49802
fix: sync package-lock.json version fields during automated version b…
Copilot ab445d9
Fix branch name in versioning.js comment: 'main' → 'master' (#1346)
Copilot 9a92a48
Extend bump-version.js to update ?v= cache-busting hashes in public/*…
Copilot 8b9849a
refactor: streamline dynamic import hash updates for public JS files
Azgaar f6837c0
refactor: enhance version bump detection using AI analysis of PR diffs
Azgaar b1dbac0
Auto versioning (#1348)
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Bump version on PR merge | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [master] | ||
| types: [closed] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| bump: | ||
| # Only run when the PR was actually merged (not just closed) | ||
| if: github.event.pull_request.merged == true | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| # Check out the base branch (master) so we are on a real branch, not | ||
| # a detached PR merge ref, which makes git push work without arguments. | ||
| ref: ${{ github.event.pull_request.base.ref }} | ||
| # fetch-depth 2 so HEAD~1 resolves to the pre-merge master commit | ||
| fetch-depth: 2 | ||
| # Use a PAT so the pushed bump commit can trigger deploy.yml | ||
| token: ${{ secrets.RELEASE_BOT_TOKEN }} | ||
|
|
||
| - name: Set up Node | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "24.x" | ||
| cache: npm | ||
|
|
||
| - name: Get PR diff | ||
| run: git diff HEAD~1 HEAD > /tmp/pr.diff | ||
|
|
||
| - name: AI-detect bump type from diff | ||
| id: bump | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| TYPE=$(node scripts/detect-bump-type.js --diff-file /tmp/pr.diff) | ||
| echo "type=$TYPE" >> "$GITHUB_OUTPUT" | ||
| echo "AI-determined bump type: $TYPE" | ||
|
|
||
| - name: Extract base version (master before this PR merged) | ||
| id: base | ||
| run: | | ||
| BASE=$(git show HEAD~1:public/versioning.js \ | ||
| | grep -oP 'const VERSION = "\K[\d.]+') | ||
| echo "version=$BASE" >> "$GITHUB_OUTPUT" | ||
| echo "Base version: $BASE" | ||
|
|
||
| - name: Run version bump script | ||
| run: | | ||
| node scripts/bump-version.js ${{ steps.bump.outputs.type }} \ | ||
| --base-version ${{ steps.base.outputs.version }} | ||
|
|
||
| - name: Commit and push bump | ||
| run: | | ||
| NEW_VERSION=$(node -e " | ||
| const m = require('fs') | ||
| .readFileSync('public/versioning.js', 'utf8') | ||
| .match(/const VERSION = \"([\d.]+)\"/); | ||
| console.log(m[1]); | ||
| ") | ||
|
|
||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| # Stage versioning files + any public/**/*.js whose dynamic import | ||
| # hashes may have been refreshed by updatePublicJsDynamicImportHashes | ||
| git add public/versioning.js package.json package-lock.json src/index.html | ||
| git add public/ 2>/dev/null || true | ||
|
|
||
| if ! git diff --cached --quiet; then | ||
| git commit -m "chore: bump version to $NEW_VERSION" | ||
| git push | ||
| echo "Pushed version bump → $NEW_VERSION" | ||
| else | ||
| echo "Nothing changed, skipping commit." | ||
| fi | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -606,4 +606,6 @@ dr_not_sam | |
| Mie96 | ||
| Riley | ||
| Amber Davis | ||
| tomtom1969vlbg`; | ||
| tomtom1969vlbg | ||
| Eric Knight | ||
| Adeline Lefizelier`; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.