File tree Expand file tree Collapse file tree 3 files changed +72
-8
lines changed Expand file tree Collapse file tree 3 files changed +72
-8
lines changed Original file line number Diff line number Diff line change 1010 runs-on : ubuntu-latest
1111 permissions :
1212 contents : write
13+ pull-requests : write
1314 steps :
1415 - uses : actions/checkout@v4
1516 with :
@@ -32,13 +33,17 @@ jobs:
3233 sed -i -e 's/spec.version = ".*"/spec.version = "${{ inputs.new_version }}"/' OpenTelemetry-Swift-Api.podspec
3334 sed -i -e 's/spec.version = ".*"/spec.version = "${{ inputs.new_version }}"/' OpenTelemetry-Swift-Sdk.podspec
3435
35- - uses : stefanzweifel/git-auto-commit-action@v5
36+ - name : Create Pull Request
37+ uses : peter-evans/create-pull-request@v7
3638 with :
37- commit_message : version bump to ${{inputs.new_version}}
38- tagging_message : ' v${{ inputs.new_version }}'
39- - uses : ncipollo/release-action@v1
40- with :
41- tag : v${{inputs.new_version}}
42- prerelease : true
43- generateReleaseNotes : true
39+ token : ${{ secrets.RELEASE_TOKEN }}
40+ branch : release/v${{inputs.new_version}}
41+ commit-message : ' Release v${{inputs.new_version}}'
42+ title : ' Release v${{inputs.new_version}}'
43+ delete-branch : true
44+ body : >
45+ This PR is auto-generated by
46+ [create-pull-request](https://github.com/peter-evans/create-pull-request).
47+ base : main
48+
4449
Original file line number Diff line number Diff line change 1+ name : Warn Release Pull Requests
2+ on :
3+ pull_request :
4+ branches :
5+ - main
6+ types :
7+ - opened
8+ jobs :
9+ Check :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ pull-requests : write
13+ steps :
14+ - name : check branch name
15+ id : check-release
16+ run : |
17+ if [[ ${{ github.head_ref }} =~ ^release/(v[0-9]+\.[0-9]+\.[0-9]+$) ]]; then
18+ echo "match=true" >> $GITHUB_OUTPUT
19+ fi
20+ - name : add comment if PR is release
21+ if : steps.check-release.outputs.match == 'true'
22+ uses : mshick/add-pr-comment@v2
23+ with :
24+ message : |
25+ **WARNING** : This PR will trigger a release and tag when merged.
Original file line number Diff line number Diff line change 1+ name : Tag & Note Release
2+ on :
3+ pull_request :
4+ branches :
5+ - main
6+ types :
7+ - closed
8+ jobs :
9+ CheckRelease :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Check if merge is release branch
13+ id : check-release
14+ run : |
15+ if [[ ${{ github.head_ref }} =~ ^release/(v[0-9]+\.[0-9]+\.[0-9]+$) ]]; then
16+ echo "match=true" >> $GITHUB_OUTPUT
17+ echo "version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
18+ fi
19+ - name : Tag if release branch
20+ if : github.event.pull_request.merged != true || steps.check-release.outputs.match != 'true'
21+ run : exit 1
22+ - uses : actions/checkout@v4
23+ with :
24+ ref : ${{ github.event.pull_request.merge_commit_sha }}
25+ fetch-depth : ' 0'
26+ - uses : stefanzweifel/git-auto-commit-action@v5
27+ with :
28+ commit_message : version bump to ${{ steps.check-release.outputs.version }}
29+ tagging_message : ' v${{ steps.check-release.outputs.version }}'
30+ - uses : ncipollo/release-action@v1
31+ with :
32+ tag : v${{ steps.check-release.outputs.version }}
33+ prerelease : true
34+ generateReleaseNotes : true
You can’t perform that action at this time.
0 commit comments