diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 13526e9083e..53a95eb8fe7 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -151,6 +151,12 @@ runs: overwrite: true if-no-files-found: error + - name: Remove tar file - prebuilt + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} + run: | + rm /tmp/prebuilt.tar + shell: bash + - name: Upload Artifact - devel if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} id: artifact-upload-step-devel @@ -163,6 +169,12 @@ runs: overwrite: true if-no-files-found: error + - name: Remove tar file - devel + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} + run: | + rm /tmp/devel.tar + shell: bash + - name: Upload Artifact - runtime if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} id: artifact-upload-step-runtime @@ -175,6 +187,12 @@ runs: overwrite: true if-no-files-found: error + - name: Remove tar file - runtime + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }} + run: | + rm /tmp/runtime.tar + shell: bash + - name: Output artifact URLs id: output-artifact-urls run: | diff --git a/.github/workflows/docker-build-and-push-main-self-hosted.yaml b/.github/workflows/docker-build-and-push-main-self-hosted.yaml index 69a553a6cb0..98b194f5d76 100644 --- a/.github/workflows/docker-build-and-push-main-self-hosted.yaml +++ b/.github/workflows/docker-build-and-push-main-self-hosted.yaml @@ -56,9 +56,25 @@ jobs: - name: Check out repository uses: actions/checkout@v4 + - name: Install vcstool + run: | + sudo apt-get -y update + sudo apt-get -y install python3-pip + pip install --no-cache-dir vcstool + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Free disk space uses: ./.github/actions/free-disk-space + - name: Run vcs import + run: | + mkdir src + vcs import src < autoware.repos + - name: Build 'autoware-openadk' uses: ./.github/actions/docker-build-and-push with: diff --git a/.github/workflows/docker-build-and-push-main.yaml b/.github/workflows/docker-build-and-push-main.yaml index bea0df4a950..729f7e9297a 100644 --- a/.github/workflows/docker-build-and-push-main.yaml +++ b/.github/workflows/docker-build-and-push-main.yaml @@ -51,9 +51,25 @@ jobs: - name: Check out repository uses: actions/checkout@v4 + - name: Install vcstool + run: | + sudo apt-get -y update + sudo apt-get -y install python3-pip + pip install --no-cache-dir vcstool + + - name: Set git config + uses: autowarefoundation/autoware-github-actions/set-git-config@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Free disk space uses: ./.github/actions/free-disk-space + - name: Run vcs import + run: | + mkdir src + vcs import src < autoware.repos + - name: Build 'autoware-openadk' uses: ./.github/actions/docker-build-and-push with: diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 07dc6046494..c7362e17069 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -40,14 +40,10 @@ WORKDIR /autoware RUN --mount=type=ssh \ ./setup-dev-env.sh -y rosdep \ && pip uninstall -y ansible ansible-core \ - && pip install --no-cache-dir vcstool \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache -WORKDIR /autoware -COPY autoware.repos /autoware/ -RUN --mount=type=ssh \ - mkdir src \ - && vcs import src < autoware.repos +# Copy repository files +COPY src /autoware/src # Generate install package lists RUN rosdep update && rosdep keys --ignore-src --from-paths src \ @@ -83,7 +79,6 @@ RUN --mount=type=ssh \ && find / -name 'libnv*.a' -delete # Install rosdep dependencies -COPY --from=src-imported /autoware/src /autoware/src COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend-packages.txt # hadolint ignore=SC2002 RUN --mount=type=ssh \ @@ -92,6 +87,7 @@ RUN --mount=type=ssh \ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Build Autoware +COPY --from=src-imported /autoware/src /autoware/src RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \ && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \ " -Wno-dev" \