1 name: Build and Push prebuilt tools container
7 - '.github/workflows/build-tools.yml'
8 - '.github/workflows/push-containers.yml'
9 - '.github/workflows/Dockerfile.tools'
16 name: Build tools with buildbot container
17 uses: ./.github/workflows/build-tools.yml
19 generate_prebuilt_artifacts: true
22 needs: build-linux-buildbot
23 name: Push prebuilt tools container
24 runs-on: ubuntu-latest
31 - name: Set lower case owner name
33 OWNER: ${{ github.repository_owner }}
35 echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV"
37 # Per branch tools container tag
38 # By default stick to latest
39 # For official test targetting openwrt stable branch
40 # Get the branch or parse the tag and push dedicated tools containers
41 # Any branch that will match this pattern openwrt-[0-9][0-9].[0-9][0-9]
42 # will refresh the tools container with the matching tag.
43 # (example branch openwrt-22.03 -> tools:openwrt-22.03)
44 # (example branch openwrt-22.03-test -> tools:openwrt-22.03)
45 - name: Determine tools container tag
49 if [ ${{ github.ref_type }} == "branch" ]; then
50 if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
51 CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\).*/\1/')"
53 elif [ ${{ github.ref_type }} == "tag" ]; then
54 if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then
55 CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
59 echo "Tools container to push tools:$CONTAINER_TAG"
60 echo "CONTAINER_TAG=$CONTAINER_TAG" >> "$GITHUB_ENV"
63 uses: actions/checkout@v3
67 - name: Download prebuilt tools from build job
68 uses: actions/download-artifact@v3
70 name: linux-buildbot-prebuilt-tools
73 - name: Login to GitHub Container Registry
74 uses: docker/login-action@v2
77 username: ${{ github.actor }}
78 password: ${{ secrets.GITHUB_TOKEN }}
80 - name: Build and push
81 uses: docker/build-push-action@v3
85 tags: ghcr.io/${{ env.OWNER_LC }}/tools:${{ env.CONTAINER_TAG }}
86 file: openwrt/.github/workflows/Dockerfile.tools