Build #6
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
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
jobs: | |
generate_matrix: | |
name: Set matrix | |
runs-on: ubuntu-latest | |
outputs: | |
sdks: ${{ steps.find_targets.outputs.sdks }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: openwrt/openwrt | |
- name: Set targets | |
id: find_targets | |
run: | | |
# sdks | |
JSON='[' | |
FIRST=1 | |
while read -r line; | |
do | |
ARCH=$(echo "$line" | cut -d " " -f 1) | |
[[ $FIRST -ne 1 ]] && JSON="$JSON"',' | |
FIRST=0 | |
JSON="$JSON"'{"arch":"'"$ARCH"'"}' | |
done <<< $(perl ./scripts/dump-target-info.pl architectures 2>/dev/null) | |
JSON="$JSON"']' | |
echo -e "\n---- sdks ----\n" | |
echo "$JSON" | |
echo -e "\n---- sdks ----\n" | |
echo "sdks=$JSON" >> "$GITHUB_OUTPUT" | |
build: | |
name: Build for ${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
needs: generate_matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJson(needs.generate_matrix.outputs.sdks) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Package | |
uses: openwrt/gh-action-sdk@main | |
env: | |
ARCH: ${{ matrix.arch }}-main | |
V: s | |
IGNORE_ERRORS: n m y | |
PACKAGES: cloudflared | |
- name: Finding failure logs | |
working-directory: logs/package/feeds | |
run: | | |
sed -ne 's!^ *ERROR: package/feeds/\(passwall[^ ]*\) .*$!\1!p' ../error.txt | sort -u | xargs -r find > ../../../logs.txt | |
cat ../../../logs.txt | |
- name: Upload Output Folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cloudflared-${{ matrix.arch }} | |
path: bin/packages/${{ matrix.arch }}/packages/cloudflared_*.ipk | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "*.ipk" |