Skip to content

Commit e3a7dc1

Browse files
committed
handling artifact name conflicts
1 parent 4eaa94b commit e3a7dc1

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
debian_distro: jammy
6262
packages_dir: test
6363
package_whitelist: '^.*/package_[ab]$'
64+
artifact_name: bloom-test-whitelist
6465

6566
- name: Verify only package_a and package_b built
6667
shell: bash
@@ -90,6 +91,7 @@ jobs:
9091
debian_distro: jammy
9192
packages_dir: test
9293
package_blacklist: '.*_test$'
94+
artifact_name: bloom-test-blacklist
9395

9496
- name: Verify package_test was excluded
9597
shell: bash
@@ -118,6 +120,7 @@ jobs:
118120
packages_dir: test
119121
package_whitelist: '^.*/package_[abc]$'
120122
package_blacklist: '^.*/package_c$'
123+
artifact_name: bloom-test-whitelist-blacklist
121124

122125
- name: Verify correct filtering
123126
shell: bash

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
package_blacklist: '' # Optional: regex to blacklist packages
3636
```
3737
38-
Artifacts are automatically uploaded as `ros-debian-packages-{distro}` and can be downloaded from the Actions tab.
38+
Artifacts are automatically uploaded as `bloom-debian-packages-{distro}-{job}-{run_id}` and can be downloaded from the Actions tab.
3939

4040
## Inputs
4141

@@ -46,6 +46,7 @@ Artifacts are automatically uploaded as `ros-debian-packages-{distro}` and can b
4646
| `packages_dir` | Directory to search for ROS packages | No | `.` |
4747
| `package_whitelist` | Regex to whitelist package names | No | `.*` |
4848
| `package_blacklist` | Regex to blacklist package names | No | `''` |
49+
| `artifact_name` | Custom artifact name (avoids conflicts in parallel jobs) | No | `bloom-debian-packages-{distro}-{job}-{run_id}` |
4950

5051
## Filtering Packages
5152

@@ -61,6 +62,34 @@ package_whitelist: '^myproject_.*'
6162
package_blacklist: '.*_(test|sim)$'
6263
```
6364

65+
## Avoiding Artifact Conflicts
66+
67+
When running multiple jobs in parallel with the same ROS distro, use custom artifact names:
68+
69+
```yaml
70+
jobs:
71+
build-all:
72+
runs-on: ubuntu-22.04
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: watonomous/bloom-release-ros@v1
76+
with:
77+
ros_distro: humble
78+
debian_distro: jammy
79+
artifact_name: bloom-all-packages
80+
81+
build-filtered:
82+
runs-on: ubuntu-22.04
83+
steps:
84+
- uses: actions/checkout@v4
85+
- uses: watonomous/bloom-release-ros@v1
86+
with:
87+
ros_distro: humble
88+
debian_distro: jammy
89+
package_whitelist: '^myproject_.*'
90+
artifact_name: bloom-myproject-packages
91+
```
92+
6493
## How It Works
6594

6695
1. Searches for all `package.xml` files in `packages_dir`

action.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ inputs:
2525
debian_distro:
2626
description: 'Debian/Ubuntu distribution (jammy, noble)'
2727
required: true
28+
artifact_name:
29+
description: 'Custom artifact name. Default: bloom-debian-packages-{ros_distro}-{job}-{run_id}'
30+
required: false
31+
default: ''
2832

2933
runs:
3034
using: 'composite'
@@ -60,9 +64,19 @@ runs:
6064
run: |
6165
${{ github.action_path }}/scripts/build.sh
6266
67+
- name: Set artifact name
68+
id: artifact-name
69+
shell: bash
70+
run: |
71+
if [ -n "${{ inputs.artifact_name }}" ]; then
72+
echo "name=${{ inputs.artifact_name }}" >> $GITHUB_OUTPUT
73+
else
74+
echo "name=bloom-debian-packages-${{ inputs.ros_distro }}-${{ github.job }}-${{ github.run_id }}" >> $GITHUB_OUTPUT
75+
fi
76+
6377
- name: Upload Debian packages
6478
uses: actions/upload-artifact@v4
6579
with:
66-
name: bloom-debian-packages-${{ inputs.ros_distro }}
80+
name: ${{ steps.artifact-name.outputs.name }}
6781
path: ./bloom-build/output/*.deb
6882
if-no-files-found: error

0 commit comments

Comments
 (0)