@@ -20,30 +20,13 @@ jobs:
2020 with :
2121 go-version : ' 1.21'
2222
23- - name : Get current version
23+ - name : Get version from VERSION file
2424 id : get_version
2525 run : |
26- $currentVersion = Get-Content VERSION -Raw
27- $currentVersion = $currentVersion.Trim()
28- Write-Host "Current version: $currentVersion"
29- echo "current_version=$currentVersion" >> $env:GITHUB_OUTPUT
30-
31- # Parse version components
32- $versionParts = $currentVersion -split '\.'
33- $major = [int]$versionParts[0]
34- $minor = [int]$versionParts[1]
35- $patch = [int]$versionParts[2]
36-
37- # Increment patch version
38- $patch++
39- $newVersion = "$major.$minor.$patch"
40- Write-Host "New version: $newVersion"
41- echo "new_version=$newVersion" >> $env:GITHUB_OUTPUT
42-
43- - name : Update version file
44- run : |
45- echo "${{ steps.get_version.outputs.new_version }}" > VERSION
46- Write-Host "Updated VERSION file to: ${{ steps.get_version.outputs.new_version }}"
26+ $version = Get-Content VERSION -Raw
27+ $version = $version.Trim()
28+ Write-Host "Building release for version: $version"
29+ echo "version=$version" >> $env:GITHUB_OUTPUT
4730
4831 - name : Create logs directory
4932 run : |
@@ -81,23 +64,20 @@ jobs:
8164 exit 1
8265 }
8366
84- - name : Commit version update
67+ - name : Log version info
8568 run : |
86- git config --local user.email "action@github.com"
87- git config --local user.name "GitHub Action"
88- git add VERSION
89- git commit -m "Bump version to ${{ steps.get_version.outputs.new_version }} [skip ci]" || exit 0
90- git push origin main || exit 0
69+ Write-Host "Building release for version: ${{ steps.get_version.outputs.version }}"
70+ Write-Host "Version is controlled by the VERSION file in the repository"
9171
9272 - name : Create Release
9373 uses : actions/create-release@v1
9474 env :
9575 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9676 with :
97- tag_name : v${{ steps.get_version.outputs.new_version }}
98- release_name : Release v${{ steps.get_version.outputs.new_version }}
77+ tag_name : v${{ steps.get_version.outputs.version }}
78+ release_name : Release v${{ steps.get_version.outputs.version }}
9979 body : |
100- ## Changes in v${{ steps.get_version.outputs.new_version }}
80+ ## Changes in v${{ steps.get_version.outputs.version }}
10181
10282 This release includes the latest changes from the main branch.
10383
0 commit comments