7 - '.github/workflows/tools.yml'
11 - '.github/workflows/tools.yml'
18 if: github.event_name != 'push'
23 uses: actions/checkout@v2
29 echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV"
30 hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
31 hdiutil attach OpenWrt.sparseimage
32 mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/
34 - name: Install required prereq on MacOS
35 working-directory: ${{ env.WORKPATH }}/openwrt
65 echo "/bin" >> "$GITHUB_PATH"
66 echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
67 echo "/usr/bin" >> "$GITHUB_PATH"
68 echo "/usr/local/bin" >> "$GITHUB_PATH"
69 echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
70 echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
71 echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
72 echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
73 echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
74 echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
75 echo "/usr/sbin" >> "$GITHUB_PATH"
78 working-directory: ${{ env.WORKPATH }}/openwrt
81 - name: Build tools MacOS
82 working-directory: ${{ env.WORKPATH }}/openwrt
83 run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
87 uses: actions/upload-artifact@v2
89 name: macos-latest-logs
90 path: ${{ env.WORKPATH }}/openwrt/logs
94 uses: actions/upload-artifact@v2
96 name: macos-latest-config
97 path: ${{ env.WORKPATH }}/openwrt/.config
100 runs-on: ubuntu-latest
101 container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
105 uses: actions/checkout@v2
109 - name: Fix permission
111 chown -R buildbot:buildbot openwrt
113 - name: Set AUTOREMOVE config for tools container
114 if: github.event_name == 'push'
115 shell: su buildbot -c "sh -e {0}"
116 working-directory: openwrt
119 echo CONFIG_DEVEL=y >> .config
120 echo CONFIG_AUTOREMOVE=y >> .config
123 shell: su buildbot -c "sh -e {0}"
124 working-directory: openwrt
127 - name: Build tools BuildBot Container
128 shell: su buildbot -c "sh -e {0}"
129 working-directory: openwrt
130 run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
134 uses: actions/upload-artifact@v2
136 name: linux-buildbot-logs
139 - name: Upload config
141 uses: actions/upload-artifact@v2
143 name: linux-buildbot-config
144 path: openwrt/.config
146 - name: Archive prebuilt tools
147 if: github.event_name == 'push'
148 shell: su buildbot -c "sh -e {0}"
149 working-directory: openwrt
150 run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host dl
152 - name: Upload prebuilt tools
153 if: github.event_name == 'push'
154 uses: actions/upload-artifact@v2
156 name: linux-buildbot-prebuilt-tools
157 path: openwrt/tools.tar
160 push-tools-container:
161 needs: build-linux-buildbot
162 runs-on: ubuntu-latest
163 if: github.event_name == 'push'
170 - name: Set lower case owner name
172 OWNER: ${{ github.repository_owner }}
174 echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV"
177 uses: actions/checkout@v2
181 - name: Download prebuilt tools from build job
182 uses: actions/download-artifact@v2
184 name: linux-buildbot-prebuilt-tools
187 - name: Login to GitHub Container Registry
188 uses: docker/login-action@v2
191 username: ${{ github.actor }}
192 password: ${{ secrets.GITHUB_TOKEN }}
194 - name: Build and push
195 uses: docker/build-push-action@v3
199 tags: ghcr.io/${{ env.OWNER_LC }}/tools:latest
200 file: openwrt/.github/workflows/Dockerfile.tools