-
Notifications
You must be signed in to change notification settings - Fork 14
46 lines (43 loc) · 1.77 KB
/
release-candidate.yml
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
name: release-candidate
on:
issues:
types: [opened, edited]
jobs:
release-candidate:
runs-on: ubuntu-latest
if: startsWith(github.event.issue.title, 'Release ')
steps:
- name: checkout
uses: actions/checkout@v2
- name: create release
id: create_release
uses: at-wat/catkin-release-action@v1
with:
issue_title: ${{ github.event.issue.title }}
git_user: Atsushi Watanabe
git_email: [email protected]
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: update library version
run: |
version=${{ steps.create_release.outputs.version}}
major=$(echo ${version} | cut -f1 -d.)
minor=$(echo ${version} | cut -f2 -d.)
patch=$(echo ${version} | cut -f3 -d.)
sudo chown -R "${USER}:" .git
git fetch origin
git checkout ${{ steps.create_release.outputs.created_branch }}
sed "s/^set(\(_YPSPUR_MAJOR_VERSION\) .*)\$/set(\1 ${major})/" -i CMakeLists.txt
sed "s/^set(\(_YPSPUR_MINOR_VERSION\) .*)\$/set(\1 ${minor})/" -i CMakeLists.txt
sed "s/^set(\(_YPSPUR_PATCH_VERSION\) .*)\$/set(\1 ${patch})/" -i CMakeLists.txt
git add CMakeLists.txt
git commit -m "Update library version"
git push origin ${{ steps.create_release.outputs.created_branch }}
- name: open pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ steps.create_release.outputs.created_branch }}
destination_branch: master
pr_title: Release ${{ steps.create_release.outputs.version }}
pr_body: close \#${{ github.event.issue.number }}
pr_assignee: ${{ github.actor }}
github_token: ${{ secrets.BLOOM_GITHUB_TOKEN }}