Skip to content

Commit

Permalink
Support SBUILD_CONF and ROSDEP_SOURCE
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke committed Jan 9, 2023
1 parent 56be0e5 commit ee253ed
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,24 @@ Convert ROS packages to Debian packages.
Repos file with list of repositories to package.
Defaults to sources.repos.

## `SBUILD_CONF`

Additional sbuild.conf lines.
For example EXTRA_REPOSITORIES, or VERBOSE.
See man sbuild.conf.

## `ROSDEP_SOURCE`

Additional rosdep sources.

## `GITHUB_TOKEN`

Set to `${{ secrets.GITHUB_TOKEN }}` to deploy to a `DEB_DISTRO-ROS_DISTRO`
branch in the same repo.
Set to `${{ secrets.GITHUB_TOKEN }}` to deploy to a `DEB_DISTRO-ROS_DISTRO` branch in the same repo.

## ``SQUASH_HISTORY``

If set to true, all previous commits on the target branch will be discarded.
For example, if you are deploying a static site with lots of binary artifacts, this can help the repository becoming overly bloated.

## `VERBOSE`

Set to true to enable verbose builds.
For example, if you are deploying a static site with lots of binary artifacts, this can help prevent the repository from becoming overlay bloated

## Example usage

Expand Down
13 changes: 9 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ inputs:
description: Repos file with list of repositories to package.
required: false
default: sources.repos
SBUILD_CONF:
description: Additional sbuild.conf lines. For example EXTRA_REPOSITORIES,
or VERBOSE. See man sbuild.conf.
required: false
ROSDEP_SOURCE:
description: Additional rosdep sources.
required: false
GITHUB_TOKEN:
description: Set to deploy to a DEB_DISTRO-ROS_DISTRO branch in the same repo.
required: false
Expand All @@ -23,9 +30,6 @@ inputs:
description: If set to true, all previous commits on the target branch will be discarded.
required: false
default: false
VERBOSE:
description: Set to true to enable verbose builds.
default: false
runs:
using: composite
steps:
Expand All @@ -45,13 +49,14 @@ runs:
env:
DEB_DISTRO: ${{ inputs.DEB_DISTRO }}
REPOS_FILE: ${{ inputs.REPOS_FILE }}
SBUILD_CONF: ${{ inputs.SBUILD_CONF }}
- name: Create packages
run: $GITHUB_ACTION_PATH/build.sh
shell: sh
env:
ROS_DISTRO: ${{ inputs.ROS_DISTRO }}
DEB_DISTRO: ${{ inputs.DEB_DISTRO }}
VERBOSE: ${{ inputs.VERBOSE }}
ROSDEP_SOURCE: ${{ inputs.ROSDEP_SOURCE }}
- name: Create apt repository
run: $GITHUB_ACTION_PATH/repository.sh
shell: sh
Expand Down
7 changes: 3 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

set -ex

test -n "$VERBOSE" && set -- --verbose

if debian-distro-info --all | grep -q "$DEB_DISTRO"; then
DISTRIBUTION=debian
elif ubuntu-distro-info --all | grep -q "$DEB_DISTRO"; then
Expand Down Expand Up @@ -45,6 +43,7 @@ for PKG in $(catkin_topological_order --only-names); do
printf "%s:\n %s:\n - %s\n" "$PKG" "$DISTRIBUTION" "ros-$ROS_DEB$(printf '%s' "$PKG" | tr '_' '-')" >> /home/runner/apt_repo/local.yaml
done
echo "yaml file:///home/runner/apt_repo/local.yaml $ROS_DISTRO" | sudo tee /etc/ros/rosdep/sources.list.d/1-local.list
printf "%s" "$ROSDEP_SOURCE" | sudo tee /etc/ros/rosdep/sources.list.d/2-remote.list

rosdep update

Expand Down Expand Up @@ -74,8 +73,8 @@ for PKG_PATH in $(catkin_topological_order --only-folders); do

# dpkg-source-opts: no need for upstream.tar.gz
sbuild --chroot-mode=unshare --no-clean-source --no-run-lintian \
--dpkg-source-opts="-Zgzip -z1 --format=1.0 -sn" \
--build-dir=/home/runner/apt_repo --extra-package=/home/runner/apt_repo "$@"
--dpkg-source-opts="-Zgzip -z1 --format=1.0 -sn" --build-dir=/home/runner/apt_repo \
--extra-package=/home/runner/apt_repo "$@"
)
COUNT=$((COUNT+1))
echo "::endgroup::"
Expand Down
3 changes: 3 additions & 0 deletions prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ $build_path = "/build/package/";
$dsc_dir = "package";
$unshare_bind_mounts = [ { directory => '/home/runner/.cache/ccache', mountpoint => '/build/ccache' } ];
EOF
echo "$SBUILD_CONF" >> ~/.sbuildrc

cat ~/.sbuildrc

echo "Checkout workspace"

Expand Down

0 comments on commit ee253ed

Please sign in to comment.