forked from jspricke/ros-deb-builder-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repository.sh
executable file
·33 lines (28 loc) · 1.49 KB
/
repository.sh
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
#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
set -ex
vcs export src --exact-with-tags > /home/runner/apt_repo/sources.repos
cd /home/runner/apt_repo
REPOSITORY="$(printf "%s" "$GITHUB_REPOSITORY" | tr / _)"
REPOSITORY_NAME=`echo "$GITHUB_REPOSITORY" | sed "s/$GITHUB_REPOSITORY_OWNER\///g"`
echo 'This repository contains packages of ROS v1 for the $DEB_DISTRO distribution. Follow the instrucctions to add it in your system.' > README.md
echo '' >> README.md
echo 'If you have gitpages activated' >> README.md
echo '```bash' >> README.md
echo "echo \"deb [trusted=yes arch=amd64] https://lepalom.github.io/$REPOSITORY_NAME $DEB_DISTRO main | sudo tee /etc/apt/sources.list.d/$REPOSITORY.list" >> README.md
echo '```' >> README.md
echo 'if not' >> README.md
echo '```bash' >> README.md
echo "echo \"deb [trusted=yes] https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$DEB_DISTRO-$ROS_DISTRO/ ./\" | sudo tee /etc/apt/sources.list.d/$REPOSITORY.list" >> README.md
echo '```' >> README.md
echo 'also, add the yaml contents' >> README.md
echo '```bash' >> README.md
echo "echo \"yaml https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$DEB_DISTRO-$ROS_DISTRO/local.yaml $ROS_DISTRO\" | sudo tee /etc/ros/rosdep/sources.list.d/1-$REPOSITORY.list" >> README.md
echo '```' >> README.md
echo '' >> README.md
echo '## Packages in the repository' >> README.md
for PKG_PATH in $(ls -d1 pool/main/r/*); do
PKG=`echo $PKG_PATH | sed "s/pool\/main\/r\///g"`
echo "[$PKG]" >> README.md
echo ' ' >> README.md
done