Skip to content

Commit 260bc9d

Browse files
authored
feat(workflow): add workflows for version control automation (#70)
Signed-off-by: Junya Sasaki <[email protected]>
1 parent a47850e commit 260bc9d

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: bump-new-version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
source_branch:
7+
description: The branch to merge from, which can be from the original or a forked repository.
8+
required: true
9+
default: main
10+
target_branch:
11+
description: The branch to merge into, owned by the original repository owner.
12+
required: true
13+
default: main
14+
bump_version:
15+
description: The type of version bump to apply.
16+
required: true
17+
default: patch
18+
type: choice
19+
options:
20+
- patch
21+
- minor
22+
- major
23+
source_repository_owner:
24+
description: The owner of the source repository (organization or user).
25+
required: false
26+
default: autowarefoundation
27+
28+
jobs:
29+
update-versions:
30+
runs-on: ubuntu-22.04
31+
steps:
32+
- name: Generate token
33+
id: generate-token
34+
uses: actions/create-github-app-token@v1
35+
with:
36+
app-id: ${{ secrets.APP_ID }}
37+
private-key: ${{ secrets.PRIVATE_KEY }}
38+
39+
- name: Run
40+
uses: autowarefoundation/autoware-github-actions/bump-new-version@v1
41+
with:
42+
github_token: ${{ steps.generate-token.outputs.token }}
43+
source_branch: ${{ github.event.inputs.source_branch }}
44+
target_branch: ${{ github.event.inputs.target_branch }}
45+
bump_version: ${{ github.event.inputs.bump_version }}
46+
source_repository_owner: ${{ github.event.inputs.source_repository_owner }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: tag release after PR merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
tag-on-merge:
9+
if: |
10+
github.event.pull_request.merged == true &&
11+
contains(
12+
join(github.event.pull_request.labels.*.name, ','),
13+
'release:bump-version'
14+
)
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Generate token
18+
id: generate-token
19+
uses: actions/create-github-app-token@v1
20+
with:
21+
app-id: ${{ secrets.APP_ID }}
22+
private-key: ${{ secrets.PRIVATE_KEY }}
23+
24+
- name: Run
25+
uses: autowarefoundation/autoware-github-actions/release-new-tag-when-merged@v1
26+
with:
27+
github_token: ${{ steps.generate-token.outputs.token }}
28+
commit_sha: ${{ github.event.pull_request.merge_commit_sha }}

0 commit comments

Comments
 (0)