forked from autowarefoundation/autoware
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request autowarefoundation#8 from tier4/sync-upstream
chore: sync upstream
- Loading branch information
Showing
68 changed files
with
1,161 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: combine-multi-arch-images | ||
description: "" | ||
|
||
inputs: | ||
package-name: | ||
description: "" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ github.token }} | ||
|
||
- name: Set image name | ||
id: set-image-name | ||
run: echo "::set-output name=image-name::ghcr.io/${{ github.repository_owner }}/${{ inputs.package-name }}" | ||
shell: bash | ||
|
||
- name: Get all tags | ||
id: get-all-tags | ||
run: | | ||
base_url="https://api.github.com/orgs/${{ github.repository_owner }}/packages/container/${{ inputs.package-name }}/versions" | ||
echo "base_url: $base_url" | ||
all_tags=() | ||
for page in $(seq 1 10); do | ||
page_url="${base_url}?page=$page" | ||
echo -e "\npage_url: $page_url" | ||
page_tags=$(curl -fsSL "$page_url" -H "Authorization: token ${{ github.token }}" | jq ".[].metadata.container.tags[]" | cut -d '"' -f 2) | ||
echo -e "\n[page_tags]\n$page_tags" | ||
if [ "$page_tags" = "" ]; then | ||
echo "No tags found in the page $page." | ||
break | ||
fi | ||
for tag in $(IFS=$'\n'; echo "$page_tags"); do | ||
all_tags+=("$tag") | ||
done | ||
done | ||
all_tags=$(printf "%s\n" ${all_tags[@]}) | ||
echo -e "\n[all_tags]\n$all_tags" | ||
echo "::set-output name=tags::$(printf "%s " $all_tags)" | ||
shell: bash | ||
|
||
- name: Get base tags | ||
id: get-base-tags | ||
run: | | ||
amd64_tags=$(printf "%s\n" $ALL_TAGS | grep "\-amd64" | sed "s/-amd64$//g") | ||
arm64_tags=$(printf "%s\n" $ALL_TAGS | grep "\-arm64" | sed "s/-arm64$//g") | ||
base_tags=$(printf "%s\n" "$amd64_tags" "$arm64_tags" | sort | uniq) | ||
echo -e "\n[amd64_tags]\n$amd64_tags" | ||
echo -e "\n[arm64_tags]\n$arm64_tags" | ||
echo -e "\n[base_tags]\n$base_tags" | ||
echo "::set-output name=tags::$(printf "%s " $base_tags)" | ||
env: | ||
ALL_TAGS: ${{ steps.get-all-tags.outputs.tags }} | ||
shell: bash | ||
|
||
- name: Create Docker manifest | ||
run: | | ||
for base_tag in $BASE_TAGS; do | ||
echo -e "\nbase_tag: $base_tag" | ||
amd64_tag=$(printf "%s\n" $ALL_TAGS | grep "^$base_tag\-amd64" || true) | ||
arm64_tag=$(printf "%s\n" $ALL_TAGS | grep "^$base_tag\-arm64" || true) | ||
echo "amd64_tag: $amd64_tag" | ||
echo "arm64_tag: $arm64_tag" | ||
if [ "$amd64_tag" != "" ]; then | ||
amd64_image="${{ steps.set-image-name.outputs.image-name }}:$amd64_tag" | ||
else | ||
echo "No amd64 tag found for '$base_tag'." | ||
amd64_image="" | ||
fi | ||
if [ "$arm64_tag" != "" ]; then | ||
arm64_image="${{ steps.set-image-name.outputs.image-name }}:$arm64_tag" | ||
else | ||
echo "No arm64 tag found for '$base_tag'." | ||
arm64_image="" | ||
fi | ||
echo "amd64_image: $amd64_image" | ||
echo "arm64_image: $arm64_image" | ||
docker manifest create ${{ steps.set-image-name.outputs.image-name }}:$base_tag \ | ||
$amd64_image \ | ||
$arm64_image | ||
docker manifest push ${{ steps.set-image-name.outputs.image-name }}:$base_tag | ||
done | ||
env: | ||
ALL_TAGS: ${{ steps.get-all-tags.outputs.tags }} | ||
BASE_TAGS: ${{ steps.get-base-tags.outputs.tags }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: create-main-distro-alias | ||
description: "" | ||
|
||
inputs: | ||
package-name: | ||
description: "" | ||
required: true | ||
rosdistro: | ||
description: "" | ||
required: true | ||
tag-name: | ||
description: "" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ github.token }} | ||
|
||
- name: Set image name | ||
id: set-image-name | ||
run: echo "::set-output name=image-name::ghcr.io/${{ github.repository_owner }}/${{ inputs.package-name }}" | ||
shell: bash | ||
|
||
- name: Create Docker manifest for latest | ||
run: | | ||
# Check image existence | ||
distro_image="${{ steps.set-image-name.outputs.image-name }}:${{ inputs.rosdistro }}-${{ inputs.tag-name }}" | ||
if docker manifest inspect "$distro_image-amd64" >/dev/null 2>&1; then | ||
amd64_image="$distro_image-amd64" | ||
fi | ||
if docker manifest inspect "$distro_image-arm64" >/dev/null 2>&1; then | ||
arm64_image="$distro_image-arm64" | ||
fi | ||
echo "amd64_image: $amd64_image" | ||
echo "arm64_image: $arm64_image" | ||
docker manifest create --amend ${{ steps.set-image-name.outputs.image-name }}:${{ inputs.tag-name }} \ | ||
$amd64_image \ | ||
$arm64_image | ||
docker manifest push ${{ steps.set-image-name.outputs.image-name }}:${{ inputs.tag-name }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: build-humble-self-hosted | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 * * 0 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-humble-self-hosted: | ||
runs-on: [self-hosted, linux, ARM64] | ||
container: ubuntu:22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: humble | ||
|
||
- name: Run setup script | ||
run: | | ||
./setup-dev-env.sh -y universe | ||
- name: Run vcs import | ||
run: | | ||
mkdir src | ||
vcs import src < autoware.repos | ||
- name: Run rosdep install | ||
run: | | ||
sudo apt-get -y update | ||
rosdep update | ||
DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro humble | ||
- name: Build | ||
run: | | ||
. /opt/ros/humble/setup.sh | ||
colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: build-humble | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 * * 0 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-humble: | ||
runs-on: ubuntu-latest | ||
container: ubuntu:22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: humble | ||
|
||
- name: Run setup script | ||
run: | | ||
./setup-dev-env.sh -y | ||
- name: Set git config | ||
uses: autowarefoundation/autoware-github-actions/set-git-config@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run vcs import | ||
run: | | ||
mkdir src | ||
vcs import src < autoware.repos | ||
- name: Run rosdep install | ||
run: | | ||
sudo apt-get -y update | ||
rosdep update | ||
DEBIAN_FRONTEND=noninteractive rosdep install -y --from-paths src --ignore-src --rosdistro humble | ||
- name: Build | ||
run: | | ||
. /opt/ros/humble/setup.sh | ||
colcon build --event-handlers console_cohesion+ --cmake-args -DCMAKE_BUILD_TYPE=Release |
6 changes: 4 additions & 2 deletions
6
.github/workflows/build-self-hosted.yaml → ...hub/workflows/build-main-self-hosted.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 10 additions & 3 deletions
13
.github/workflows/build.yaml → .github/workflows/build-main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.