Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build-openwrt.yml #9

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: (!cancelled())
run: |
[ -d openwrt-armvirt ] || mkdir -p openwrt-armvirt
curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" | grep -o "openwrt_N1_.*/openwrt-armvirt-.*\.tar.gz" | head -n 1 > DOWNLOAD_ARMVIRT
curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/openwrt_N1_openwrt-dev" | grep -o "openwrt_N1_.*/openwrt-armvirt-.*\.tar.gz" | head -n 1 > DOWNLOAD_ARMVIRT
[ -s DOWNLOAD_ARMVIRT ] && wget -q -P openwrt-armvirt https://github.com/${GITHUB_REPOSITORY}/releases/download/$(cat DOWNLOAD_ARMVIRT)

- name: Package Armvirt as OpenWrt
Expand All @@ -33,13 +33,13 @@ jobs:
OPENWRT_ARMVIRT: openwrt-armvirt/*.tar.gz
PACKAGE_SOC: s905d
OPENWRT_VER: lede-r6025-b65b15a30
DISTRIB_REVISION: lede-r6025-b65b15a3

KERNEL_VERSION_NAME: 5.15.115

- name: Upload OpenWrt Firmware to Release
uses: ncipollo/release-action@v1
with:
tag: openwrt_N1_${{ env.PACKAGED_OUTPUTDATE }}
tag: openwrt_N1_dev_${{ env.PACKAGED_OUTPUTDATE }}
artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
allowUpdates: true
token: ${{ secrets.RELEASES_TOKEN }}
Expand Down
29 changes: 22 additions & 7 deletions .github/workflows/build-openwrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
REPO_TAG: 20230609
BUILD_MAIN: true
FEEDS_CONF: feeds.conf.default
CONFIG_FILE: .config
DIY_P1_SH: diy-part1.sh
Expand Down Expand Up @@ -71,8 +72,16 @@ jobs:
working-directory: /workdir
run: |
df -hT $PWD
#git clone $REPO_URL -b $REPO_BRANCH openwrt
if [ $BUILD_MAIN == "true" ]
then
echo "checkout main"
git clone $REPO_URL -b $REPO_BRANCH openwrt
else
echo "checkout tag $REPO_TAG"
git clone -b $REPO_TAG --depth 1 $REPO_URL openwrt
fi


ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt

- name: 加载自定义feeds
Expand Down Expand Up @@ -122,7 +131,7 @@ jobs:
echo "清理之前:"
df -hT
mkdir openwrt-armvirt
mv openwrt/bin/targets/*/*/*.tar.gz openwrt-armvirt/
mv openwrt/bin/targets/* openwrt-armvirt/
echo -e "\n"
echo "列出空间占用前10的目录或文件:"
sudo du -h --max-depth=1 /workdir/openwrt |sort -nr | head -10
Expand All @@ -141,15 +150,21 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/openwrt-armvirt/
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
ls

ls -lah


- name: Upload bin directory
uses: actions/upload-artifact@main
if: steps.compile.outputs.status == 'success'
with:
name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: openwrt-armvirt

- name: 发布固件
uses: ncipollo/release-action@v1
with:
tag: openwrt_N1_openwrt-armvirt
artifacts: openwrt-armvirt/*
tag: openwrt_N1_openwrt-dev
artifacts: openwrt-armvirt/armvirt/64/*
allowUpdates: true
token: ${{ secrets.RELEASES_TOKEN }}
body: |
Expand All @@ -172,6 +187,6 @@ jobs:
keep_latest: 5
#keep_latest: ${{ github.event.inputs.rele }}
delete_tags: true
delete_tag_pattern: 'openwrt_N1_openwrt-armvirt'
delete_tag_pattern: 'openwrt_N1_openwrt-dev'
env:
GITHUB_TOKEN: ${{ secrets.RELEASES_TOKEN }}