-
-
Notifications
You must be signed in to change notification settings - Fork 107
98 lines (82 loc) · 3.29 KB
/
version-bump.yml
File metadata and controls
98 lines (82 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Version Bump Workflow
# This workflow helps automate version bumping after a release
# It can be manually triggered to update version numbers across all packages
name: Version Bump
on:
workflow_dispatch:
inputs:
new_version:
description: 'New version number (e.g., 3.1.1 or 3.2.0). No -SNAPSHOT suffix — the release workflow adds it automatically for develop builds.'
required: true
type: string
bump_type:
description: 'Type of version bump'
required: true
type: choice
options:
- patch
- minor
- major
default: patch
jobs:
bump-version:
name: Bump Version Numbers
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Make scripts executable
run: chmod +x tools/build/scripts/*.sh
- name: Update Version Numbers
env:
NEW_VERSION: ${{ github.event.inputs.new_version }}
run: |
echo "Updating to version: $NEW_VERSION"
# Update root box.json
jq --arg version "$NEW_VERSION" '.version = $version | .dependencies."wheels-core" = ("^" + $version)' \
box.json > box.json.tmp
mv box.json.tmp box.json
# Update examples/starter-app/box.json
jq --arg version "$NEW_VERSION" '.version = $version | .dependencies."wheels-core" = ("^" + $version)' \
examples/starter-app/box.json > examples/starter-app/box.json.tmp
mv examples/starter-app/box.json.tmp examples/starter-app/box.json
echo "Version updated to $NEW_VERSION"
- name: Generate Changelog from Merged PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_VERSION: ${{ github.event.inputs.new_version }}
run: |
./tools/build/scripts/generate-changelog.sh "$NEW_VERSION" "" --write
- name: Commit Changes
env:
NEW_VERSION: ${{ github.event.inputs.new_version }}
run: |
git add box.json
git add examples/starter-app/box.json
git add CHANGELOG.md
git commit -m "Bump version to $NEW_VERSION
Automated version bump and changelog generation using GitHub Actions."
git push origin main
- name: Create Summary
env:
NEW_VERSION: ${{ github.event.inputs.new_version }}
BUMP_TYPE: ${{ github.event.inputs.bump_type }}
run: |
echo "## Version Bump Complete" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**New Version:** $NEW_VERSION" >> $GITHUB_STEP_SUMMARY
echo "**Bump Type:** $BUMP_TYPE" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Files Updated:" >> $GITHUB_STEP_SUMMARY
echo "- box.json" >> $GITHUB_STEP_SUMMARY
echo "- examples/starter-app/box.json" >> $GITHUB_STEP_SUMMARY
echo "- CHANGELOG.md (auto-generated from merged PRs)" >> $GITHUB_STEP_SUMMARY