Skip to content

Commit

Permalink
feat: add the ability to specify version
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBlenny committed May 24, 2022
1 parent eed6522 commit 14a67fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/action-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Test output directory
run: test $(ls -1 output | wc -l) -eq 6

action-test-with-unique-version:
action-test-with-version:
runs-on: ubuntu-20.04
steps:
- name: Checkout this repository
Expand All @@ -122,13 +122,13 @@ jobs:
mv examples/rclpy/topics pytopics || true
rm -rf examples test || true
- name: Test the action with unique version
- name: Test the action with version
uses: ./
with:
ros2-distro: foxy
unique-version: true
version: 1.1.0

- name: Test unique version
- name: Test version
run: |
(for PACKAGE in $(ls)
do
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ inputs:
description: 'The output directory of build results.'
required: false
default: 'package'
unique-version:
description: 'Make the package version unique by using a timestamp for the Debian revision number.'
version:
description: 'The version / debian increment.'
required: false
default: 'false'
runs:
Expand All @@ -24,5 +24,5 @@ runs:
run: bash ${{ github.action_path }}/scripts/setup-dependencies.bash ${{ inputs.ros2-distro }}
shell: bash
- name: Build Debian packages
run: bash ${{ github.action_path }}/scripts/build-debian.bash ${{ inputs.ros2-distro }} ${{ inputs.output-dir }} ${{ inputs.unique-version }}
run: bash ${{ github.action_path }}/scripts/build-debian.bash ${{ inputs.ros2-distro }} ${{ inputs.output-dir }} ${{ inputs.version }}
shell: bash
6 changes: 3 additions & 3 deletions scripts/build-debian.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ROS2_DISTRO="$1"
OUTPUT_DIR="$2"
UNIQUE_VERSION="$3"
VERSION="$3"

ROOT_DIR=$(pwd)

Expand All @@ -19,11 +19,11 @@ do
source /opt/ros/$ROS2_DISTRO/setup.bash || exit $?

# Generate Debian rules
if [ "$UNIQUE_VERSION" == "false" ]
if [ "$VERSION" == "false" ]
then
bloom-generate rosdebian --ros-distro "$ROS2_DISTRO" || exit $?
else
bloom-generate rosdebian --ros-distro "$ROS2_DISTRO" -i $(date +%s) || exit $?
bloom-generate rosdebian --ros-distro "$ROS2_DISTRO" -i "$VERSION" || exit $?
fi

# Build package using fakeroot
Expand Down

0 comments on commit 14a67fc

Please sign in to comment.