Skip to content

Commit 0f8da31

Browse files
committed
Update version script
1 parent 7773468 commit 0f8da31

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
required: true
99
type: string
1010

11+
permissions:
12+
contents: write
13+
actions: read
14+
1115
jobs:
1216
release:
1317
name: Create Proper Release on All Platforms
@@ -62,6 +66,9 @@ jobs:
6266
steps:
6367
- name: Checkout code
6468
uses: actions/checkout@v3
69+
with:
70+
token: ${{ secrets.GITHUB_TOKEN }}
71+
fetch-depth: 0
6572

6673
- name: Set up Python
6774
uses: actions/setup-python@v4
@@ -75,6 +82,36 @@ jobs:
7582
python3 -m pip install --upgrade pip
7683
pip install PyYAML requests
7784
85+
- name: Parse version and update Go source
86+
run: |
87+
# Parse version input (e.g., "4.1.0" -> major=4, minor=1, build=0)
88+
VERSION="${{ github.event.inputs.version }}"
89+
IFS='.' read -r MAJOR MINOR BUILD <<< "$VERSION"
90+
91+
echo "Updating version to $MAJOR.$MINOR.$BUILD"
92+
python3 .github/workflows/update_version.py "$MAJOR" "$MINOR" "$BUILD"
93+
94+
# Configure git
95+
git config --local user.email "action@github.com"
96+
git config --local user.name "GitHub Action"
97+
98+
# Check if there are changes
99+
if git diff --quiet; then
100+
echo "No version changes detected"
101+
else
102+
echo "Committing version update"
103+
git add cf_cli_java_plugin.go README.md
104+
git commit -m "Set version to v$VERSION"
105+
git push
106+
fi
107+
108+
- name: Create and push tag
109+
run: |
110+
VERSION="${{ github.event.inputs.version }}"
111+
echo "Creating tag v$VERSION"
112+
git tag "v$VERSION"
113+
git push origin "v$VERSION"
114+
78115
- name: Download all build artifacts
79116
uses: actions/download-artifact@v3
80117
with:
@@ -119,6 +156,10 @@ jobs:
119156
120157
Plugin for profiling Java applications and getting heap and thread-dumps.
121158
159+
## Changes
160+
161+
$(cat release_changelog.txt || echo "No changelog available")
162+
122163
## Installation
123164
124165
### Installation via CF Community Repository

0 commit comments

Comments
 (0)