File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Create release branch
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ BRANCH_NAME :
7+ description : The source branch to create a release branch from
8+ required : true
9+ NEXT_VERSION :
10+ description : New version to set in the source branch (e.g. 5.6.0)
11+ required : true
12+
13+ jobs :
14+ make-branch :
15+ name : Create release branch from `${{ inputs.BRANCH_NAME }}`
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v5
19+ with :
20+ ref : ${{ inputs.BRANCH_NAME }}
21+
22+ - name : Determine project version
23+ id : project_version
24+ run : |
25+ echo "version=$(jq --raw-output '.version' vcpkg.json)" >> ${GITHUB_OUTPUT}
26+
27+ - name : Create `${{ steps.project_version.outputs.version }}` branch
28+ run : |
29+ git checkout -b ${{ steps.project_version.outputs.version }}
30+ git push origin ${{ steps.project_version.outputs.version }}
31+
32+ update-version :
33+ name : Update next version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEXT_VERSION }}`
34+ runs-on : ubuntu-latest
35+ env :
36+ NEW_VERSION : ${{ inputs.NEXT_VERSION }}
37+ steps :
38+ - uses : actions/checkout@v5
39+ with :
40+ ref : ${{ inputs.BRANCH_NAME }}
41+
42+ - name : Update `vcpkg.json`
43+ run : |
44+ cat <<< $(jq --arg ver "${NEW_VERSION}" '.version = $ver' vcpkg.json) > vcpkg.json
45+
46+ - name : Update `CMakeLists.txt`s
47+ run : |
48+ find . -name 'CMakeLists.txt' | \
49+ xargs perl -0777 -i -pe 's/(project\s*\([^)]*?\bVERSION\s+)\S+/\1$ENV{NEW_VERSION}/s'
50+
51+ - name : Create Pull Request
52+ uses : peter-evans/create-pull-request@v7
53+ with :
54+ branch : Update_version_to_${{ inputs.NEXT_VERSION }}_run_${{ github.run_id }}
55+ title : Update development version to `${{ inputs.NEXT_VERSION }}`
56+ body : " "
You can’t perform that action at this time.
0 commit comments