|
@@ -65,13 +65,15 @@ jobs:
|
|
|
if [ ${{matrix.target}} == "x86_64" ]; then
|
|
|
echo "ARCH=linux/amd64" >> $GITHUB_ENV
|
|
|
echo "MTARGET=x86_64" >> $GITHUB_ENV
|
|
|
- elif [ ${{matrix.target}} == "phicomm-N1" ]; then
|
|
|
+ elif [[ ${{matrix.target}} =~ (armvirt_64|ipq807x|mediatek_mt7622) ]]; then
|
|
|
echo "MTARGET=aarch64_cortex-a53" >> $GITHUB_ENV
|
|
|
+ elif [[ ${{matrix.target}} == "ramips_mt7621" ]]; then
|
|
|
+ echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV
|
|
|
else
|
|
|
echo "ARCH=linux/arm64" >> $GITHUB_ENV
|
|
|
- if [[ ${{matrix.target}} == "Rpi-4B" ]]; then
|
|
|
+ if [[ ${{matrix.target}} == "bcm27xx_bcm2711" ]]; then
|
|
|
echo "MTARGET=aarch64_cortex-a72" >> $GITHUB_ENV
|
|
|
- else
|
|
|
+ elif [[ ${{matrix.target}} == "rockchip" ]]; then
|
|
|
echo "MTARGET=aarch64_generic" >> $GITHUB_ENV
|
|
|
fi
|
|
|
fi
|
|
@@ -99,6 +101,8 @@ jobs:
|
|
|
sudo -E apt-get -qq autoremove --purge
|
|
|
sudo -E apt-get -qq clean ) &
|
|
|
sudo timedatectl set-timezone "$TZ"
|
|
|
+ sudo mkdir -p /workdir
|
|
|
+ sudo chown $USER:$GROUPS /workdir
|
|
|
|
|
|
- name: Get current date
|
|
|
id: date
|
|
@@ -109,37 +113,35 @@ jobs:
|
|
|
[ "$VERSION" ] && echo "VERSION=$VERSION" >> $GITHUB_ENV || echo "VERSION=$(date +'%m.%d')" >> $GITHUB_ENV
|
|
|
|
|
|
- name: Clone source code
|
|
|
+ working-directory: /workdir
|
|
|
run: |
|
|
|
[ "${{ env.REPO_BRANCH }}" ] ||
|
|
|
REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \
|
|
|
-H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \
|
|
|
-X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v21 | tail -n 1 | sed -e 's/v//')"
|
|
|
git clone $REPO_URL -b v$REPO_BRANCH openwrt
|
|
|
- if [[ "${{ contains(github.event.action, 'sdk') }}" == "true" ]]; then
|
|
|
+ if [[ "${{ contains(github.event.action, 'nosdk') }}" != "true" ]]; then
|
|
|
cd openwrt
|
|
|
if [[ ${{matrix.target}} == "x86_64" ]]; then
|
|
|
- curl -fL -m 60 -o sdk.tar.xz https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/x86/64/openwrt-sdk-$REPO_BRANCH-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -m 60 -o sdk.tar.xz https://openwrt.tetaneutral.net/releases/21.02-SNAPSHOT/targets/x86/64/openwrt-sdk-21.02-SNAPSHOT-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz
|
|
|
- elif [[ ${{matrix.target}} == nanopi* ]]; then
|
|
|
- curl -fL -m 60 -o sdk.tar.xz https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/rockchip/armv8/openwrt-sdk-$REPO_BRANCH-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -m 60 -o sdk.tar.xz https://openwrt.tetaneutral.net/releases/21.02-SNAPSHOT/targets/rockchip/armv8/openwrt-sdk-21.02-SNAPSHOT-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz
|
|
|
- elif [[ ${{matrix.target}} =~ "Rpi-4B" ]]; then
|
|
|
- curl -fL -m 60 -o sdk.tar.xz https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/bcm27xx/bcm2711/openwrt-sdk-$REPO_BRANCH-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -m 60 -o sdk.tar.xz https://openwrt.tetaneutral.net/releases/21.02-SNAPSHOT/targets/bcm27xx/bcm2711/openwrt-sdk-21.02-SNAPSHOT-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz
|
|
|
- elif [[ ${{matrix.target}} =~ "phicomm-N1" ]]; then
|
|
|
- curl -fL -m 60 -o sdk.tar.xz https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/armvirt/64/openwrt-sdk-$REPO_BRANCH-armvirt-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -m 60 -o sdk.tar.xz https://openwrt.tetaneutral.net/releases/21.02-SNAPSHOT/targets/armvirt/64/openwrt-sdk-21.02-SNAPSHOT-armvirt-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/x86/64/openwrt-sdk-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
+ elif [[ ${{matrix.target}} == "rockchip" ]]; then
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/rockchip/armv8/openwrt-sdk-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
+ elif [[ ${{matrix.target}} == "bcm27xx_bcm2711" ]]; then
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/bcm27xx/bcm2711/openwrt-sdk-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
+ elif [[ ${{matrix.target}} == "armvirt_64" ]]; then
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/armvirt/64/openwrt-sdk-armvirt-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
+ elif [[ ${{matrix.target}} == "ramips_mt7621" ]]; then
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/ramips/mt7621/openwrt-sdk-ramips-mt7621_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
+ elif [[ ${{matrix.target}} == "mediatek_mt7622" ]]; then
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/mediatek/mt7622/openwrt-sdk-mediatek-mt7622_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
+ elif [[ ${{matrix.target}} == "ipq807x" ]]; then
|
|
|
+ curl -fL -m 60 -o sdk.tar.xz https://op.supes.top/releases/$REPO_BRANCH/targets/ipq807x/generic/openwrt-sdk-ipq807x-generic_gcc-8.4.0_musl.Linux-x86_64.tar.xz || true
|
|
|
fi
|
|
|
fi
|
|
|
+ ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
|
|
|
echo "REPO_BRANCH=$REPO_BRANCH" >> $GITHUB_ENV
|
|
|
echo "$REPO_BRANCH"
|
|
|
|
|
|
- - name: Free up disk space
|
|
|
- if: env.FREE_UP_DISK == 'true'
|
|
|
- env:
|
|
|
- DEBIAN_FRONTEND: noninteractive
|
|
|
- run: |
|
|
|
- sudo mkdir -p -m 777 /mnt/openwrt/dl /mnt/openwrt/staging_dir /mnt/openwrt/build_dir/hostpkg openwrt/build_dir
|
|
|
- ln -sf /mnt/openwrt/dl openwrt/dl
|
|
|
- ln -sf /mnt/openwrt/staging_dir openwrt/staging_dir
|
|
|
- ln -sf /mnt/openwrt/build_dir/hostpkg openwrt/build_dir/hostpkg
|
|
|
-
|
|
|
- name: Load custom configuration
|
|
|
run: |
|
|
|
cp -rf devices/common/. openwrt/
|
|
@@ -193,20 +195,21 @@ jobs:
|
|
|
run: |
|
|
|
cd openwrt
|
|
|
make download -j$(($(nproc)+1)) &
|
|
|
+ sleep 5
|
|
|
|
|
|
- - name: Cache
|
|
|
- uses: klever1988/cachewrtbuild@main
|
|
|
- with:
|
|
|
- ccache: 'true'
|
|
|
- clean: ${{ contains(github.event.action, 'nocache') }}
|
|
|
- prefix: ${{ github.workspace }}/openwrt
|
|
|
+ #- name: Cache
|
|
|
+ # uses: klever1988/cachewrtbuild@main
|
|
|
+ # with:
|
|
|
+ # ccache: 'true'
|
|
|
+ # clean: ${{ contains(github.event.action, 'nocache') }}
|
|
|
+ # prefix: ${{ github.workspace }}/openwrt
|
|
|
|
|
|
- name: Compile the firmware
|
|
|
id: compile
|
|
|
run: |
|
|
|
cd openwrt
|
|
|
echo -e "$(($(nproc)+1)) thread compile"
|
|
|
- make -j$(($(nproc)+1)) || make -j1 V=s
|
|
|
+ make -j$(($(nproc)+1)) || (curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage" ; make -j1 V=s)
|
|
|
echo "::set-output name=status::success"
|
|
|
mv -f .config ${{matrix.target}}.config
|
|
|
|
|
@@ -226,8 +229,7 @@ jobs:
|
|
|
rename -v "s/openwrt-/${{ env.VERSION }}-openwrt-/" ./firmware/*/* || true
|
|
|
rename -v "s/friendlyarm_//" ./firmware/*/*gz || true
|
|
|
rename -v "s/embedfire_//" ./firmware/*/*gz || true
|
|
|
- rename -v "s/xiaomi_redmi-router/redmi/" *bin || true
|
|
|
- rename -v "s/xiaoyu_)//" *bin || true
|
|
|
+ rename -v "s/xiaomi_redmi-router/redmi/" ./firmware/*/*bin || true
|
|
|
mkdir ${{ env.REPO_BRANCH }}
|
|
|
cp -rf openwrt/bin/targets ${{ env.REPO_BRANCH }}/
|
|
|
Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
|
|
@@ -250,7 +252,7 @@ jobs:
|
|
|
|
|
|
- name: Deploy kmods to server
|
|
|
uses: easingthemes/ssh-deploy@main
|
|
|
- if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') && env.MTARGET
|
|
|
+ if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser')
|
|
|
with:
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
ARGS: "-avzr"
|
|
@@ -283,7 +285,7 @@ jobs:
|
|
|
|
|
|
- name: remote ssh command
|
|
|
uses: appleboy/ssh-action@master
|
|
|
- if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') && env.MTARGET
|
|
|
+ if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser')
|
|
|
with:
|
|
|
host: op.supes.top
|
|
|
username: root
|
|
@@ -360,7 +362,7 @@ jobs:
|
|
|
- name: Build and push docker image
|
|
|
uses: docker/build-push-action@master
|
|
|
continue-on-error: true
|
|
|
- if: env.DOCKER_ID && env.DOCKER_PASSWD && ! contains(github.event.action, 'noser')
|
|
|
+ if: env.DOCKER_ID && env.DOCKER_PASSWD && ! contains(github.event.action, 'noser') && ${{matrix.target}} == "x86_64"
|
|
|
with:
|
|
|
platforms: ${{ env.ARCH }}
|
|
|
file: Dockerfile
|
|
@@ -380,7 +382,7 @@ jobs:
|
|
|
if: env.TELEGRAM_TOKEN && ! contains(github.event.action, 'notg')
|
|
|
continue-on-error: true
|
|
|
run: |
|
|
|
- [ steps.compile.outputs.status == 'success' ] && curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋 https://op.supes.top/firmware/${{matrix.target}}/ ${{ env.COWURL }} ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage" || curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage"
|
|
|
+ curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋 https://op.supes.top/firmware/${{matrix.target}}/ ${{ env.COWURL }} ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage"
|
|
|
|
|
|
- name: Delete workflow runs
|
|
|
uses: GitRML/delete-workflow-runs@main
|