-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (100 loc) · 3.33 KB
/
generate_rosdep_yaml.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: generate_rosdep_yaml
on:
schedule:
- cron: 0 0 * * *
push:
branches: [ master ]
workflow_dispatch:
jobs:
generate_rosdep_yaml:
name: generate_rosdep_yaml
runs-on: ubuntu-22.04
steps:
- name: basic install
run: |
sudo apt install make ansible
- name: ansible version
run: |
ansible-playbook --version
- name: Setup ROS2 humble environment
uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble
- uses: actions/checkout@v2-beta
- name: run ansible
run: |
ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos_full.yml --connection local --become -e ansible_user=ubuntu
- name: run script
run: |
python3 generate_rosdep_yaml.py ../robotx_ws/src/
working-directory: scripts
- uses: actions/upload-artifact@v2
with:
name: rosdep_yaml
path: scripts/rosdep.yaml
- uses: actions/upload-artifact@v2
with:
name: repos_file
path: ansible/packages.repos
deploy_to_ouxt_distro:
name: deploy_to_ouxt_distro
runs-on: ubuntu-22.04
needs: generate_rosdep_yaml
steps:
- uses: actions/checkout@v2
with:
repository: OUXT-Polaris/ouxt_distro
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
- uses: actions/download-artifact@v2
with:
name: rosdep_yaml
- uses: actions/download-artifact@v2
with:
name: repos_file
- name: Check branch exist
id: check_branch
run: |
echo "::set-output name=exist::$(git ls-remote --heads https://github.com/OUXT-Polaris/ouxt_distro.git deploy | wc -l)"
- name: Count changes
id: changes
run: |
git add -N .
echo "::set-output name=count::$(git diff --name-only | wc -l)"
- name: Check default branch
id: check_default_branch
run: |
echo "::set-output name=default_branch::$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"
- uses: peter-evans/create-pull-request@v3
id: create_pull_request
if: steps.check_branch.outputs.exist == 0 && steps.changes.outputs.count > 0
with:
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
commit-message: Update rosdep.yaml
committer: wam-v-tan <[email protected]>
author: wam-v-tan <[email protected]>
signoff: false
branch: deploy
base: ${{ steps.check_default_branch.outputs.default_branch }}
delete-branch: true
title: '[Bot] Update workflow'
body: |
# Description
Update rosdep.yaml
# How to check
Please check passing all CI test.
labels: |
bot
assignees: wam-v-tan
reviewers: wam-v-tan
team-reviewers: |
owners
maintainers
draft: false
- name: Enable Pull Request Automerge
if: steps.create_pull_request.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }}
merge-method: squash
repository: OUXT-Polaris/ouxt_distro