antennine.org: add test profiles for 8/64 devices with openwrt-24.10.3 #101
This file contains hidden or 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
| name: Build network profiles | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| # Build all packages for x86_64 | |
| generate_matrix: | |
| name: 'Generate matrix' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix_builds: ${{ steps.define_matrix.outputs.matrix_builds }} | |
| dest_dir: ${{ steps.set_package_destination.outputs.dest_dir }} | |
| steps: | |
| - name: Set package destination | |
| id: set_package_destination | |
| run: | | |
| export TAG=$(echo "${{ github.ref }}" | cut -d '/' -f 3- | perl -pe 's/v([0-9])/$1/') | |
| echo "$TAG" | |
| echo "DEST_DIR=$TAG" >> $GITHUB_OUTPUT | |
| - name: Define matrix of branches and archs | |
| id: define_matrix | |
| run: | | |
| JSON='[' | |
| FIRST_BUILD=1 | |
| versions=$(curl https://downloads.openwrt.org/.versions.json) | |
| stable=$(echo $versions | jq | grep \"stable_ | sed 's|.*\"stable_version\": \"\(.*\)\",|\1|') | |
| oldstable=$(echo $versions | jq | grep oldstable_ | sed 's|.*\"oldstable_version\": \"\(.*\)\",|\1|') | |
| for version in "main" "${stable:0:5}" "${oldstable:0:5}"; do | |
| VERSION=$([ "$version" == "main" ] \ | |
| && echo "main" || echo "openwrt-$version") | |
| echo $VERSION | |
| OPENWRT_BRANCH_PATH="openwrt-$version" | |
| echo $OPENWRT_BRANCH_PATH | |
| PKG_MANAGER_PATH=$([ "$version" != "main" ] && [ "${version:0:2}" -lt 25 ] \ | |
| && echo "" || echo "apk/") | |
| [[ $FIRST_BUILD -ne 1 ]] && JSON="$JSON"',' | |
| FIRST_BUILD=0 | |
| JSON="$JSON"'{"version": "'"$VERSION"'" , "pkg_manager_path": "'"$PKG_MANAGER_PATH"'", "openwrt_branch_path": "'"$OPENWRT_BRANCH_PATH"'" }' | |
| done | |
| echo $JSON | |
| matrix_include='{"include": '"$JSON"']}' | |
| echo "matrix_builds=${matrix_include}" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build ${{ matrix.openwrt_branch_path }} x86_64 | |
| runs-on: ubuntu-latest | |
| needs: generate_matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build packages | |
| uses: openwrt/gh-action-sdk@v9 | |
| env: | |
| ARCH: x86_64-${{ matrix.version }} | |
| FEEDNAME: "profiles" | |
| IGNORE_ERRORS: "n m y" | |
| KEY_BUILD: "${{ secrets.KEY_BUILD }}" | |
| PRIVATE_KEY: "${{ secrets.PRIVATE_KEY }}" | |
| INDEX: 1 | |
| NO_DEFAULT_FEEDS: 1 | |
| NO_REFRESH_CHECK: 1 | |
| NO_SHFMT_CHECK: 1 | |
| # V: sc | |
| - name: Prepare artifacts paths | |
| run: | | |
| bin_path="bin_dir/${{ matrix.openwrt_branch_path }}/x86_64" | |
| mkdir -p "$bin_path" | |
| mv bin/packages/x86_64/profiles/* "$bin_path" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.openwrt_branch_path }} | |
| path: bin_dir/ | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| if: ${{ always() }} | |
| needs: [generate_matrix, build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout lime-feed | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: libremesh/lime-feed | |
| path: lime-feed | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| path: artifacts/profiles/ | |
| - name: Replace packages | |
| run: | | |
| for branch in $(ls artifacts/profiles/); do | |
| rm -rf lime-feed/profiles/$branch/x86_64 | |
| done; | |
| cp -r artifacts/profiles/* lime-feed/profiles/ | |
| - name: Upload packages to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
| external_repository: libremesh/lime-feed | |
| publish_dir: ./lime-feed/profiles/ | |
| destination_dir: profiles |