Build: combine jobs
This commit is contained in:
59
.github/workflows/lo-test.yml
vendored
59
.github/workflows/lo-test.yml
vendored
@@ -218,54 +218,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate firmware
|
- name: Generate firmware
|
||||||
run: |
|
run: |
|
||||||
sudo sysctl vm.swappiness=0
|
|
||||||
curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf -
|
|
||||||
mv *imagebuilder* ib && cd ib
|
|
||||||
. $GITHUB_WORKSPACE/merge_files.sh
|
|
||||||
sed -i '/local/d;s/#//' files/etc/opkg/distfeeds.conf
|
|
||||||
sed -i 's/luci-app-[^ ]*//g' include/target.mk $(find target/ -name Makefile)
|
|
||||||
sed -i 's/$(OPKG) install $(BUILD_PACKAGES)/$(OPKG) install --force-overwrite $(BUILD_PACKAGES)/' Makefile
|
|
||||||
PACKAGES=$(cat $GITHUB_WORKSPACE/$DEVICE.config.seed | grep CONFIG_PACKAGE | sed '/dnsmasq_full_dhcpv6/d;/INCLUDE/d' | grep -v luci-app | sed 's/CONFIG_PACKAGE_//;s/=y//' | xargs echo)
|
|
||||||
LUCI=$(echo `cat $GITHUB_WORKSPACE/$DEVICE.config.seed | grep CONFIG_PACKAGE | sed '/dnsmasq_full_dhcpv6/d;/INCLUDE/d;/docker/d' | grep luci-app | sed 's/CONFIG_PACKAGE_//;s/=y//'`)
|
|
||||||
LP=$(cd packages; echo $LUCI | sed 's/-app-/-i18n-/g;s/ /\n/g' | xargs -n1 -i sh -c 'ls {}-zh-cn* 2>/dev/null' | sed 's/zh-.*.ipk/zh-cn/' | xargs echo)
|
|
||||||
make image PACKAGES="$PACKAGES $LUCI $LP luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn" FILES="files"
|
|
||||||
|
|
||||||
mkdir -p $GITHUB_WORKSPACE/release
|
|
||||||
mv $(ls -1 ./bin/targets/*/*/*img.gz | head -1) $GITHUB_WORKSPACE/release/$DEVICE.img.gz
|
|
||||||
cd $GITHUB_WORKSPACE/release/ && md5sum $DEVICE.img.gz > $DEVICE.img.gz.md5
|
|
||||||
gzip -dc $DEVICE.img.gz | md5sum | sed "s/-/$DEVICE.img/" > $DEVICE.img.md5
|
|
||||||
echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV
|
|
||||||
echo "strDevice=$(echo $DEVICE | awk '{print toupper($0)}')" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Upload release asset
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
file: ./release/*
|
|
||||||
tag: ${{env.strDate}}
|
|
||||||
file_glob: true
|
|
||||||
overwrite: true
|
|
||||||
release_name: ${{env.strDate}} 自动发布
|
|
||||||
|
|
||||||
generate_firmware_with_docker:
|
|
||||||
needs: build_packages
|
|
||||||
if: always()
|
|
||||||
name: Generate ${{ github.event.client_payload.device || github.event.inputs.device }} firmware with docker
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
env:
|
|
||||||
DEVICE: ${{ github.event.client_payload.device || github.event.inputs.device }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Generate firmware
|
|
||||||
run: |
|
|
||||||
if [[ ${{ github.event.client_payload.device || github.event.inputs.device }} == *"r1s"* ]]; then
|
|
||||||
sudo poweroff
|
|
||||||
fi
|
|
||||||
sudo sysctl vm.swappiness=0
|
sudo sysctl vm.swappiness=0
|
||||||
curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf -
|
curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf -
|
||||||
mv *imagebuilder* ib && cd ib
|
mv *imagebuilder* ib && cd ib
|
||||||
@@ -285,6 +237,17 @@ jobs:
|
|||||||
echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV
|
echo "strDate=$(TZ=UTC-8 date +%Y-%m-%d)" >> $GITHUB_ENV
|
||||||
echo "strDevice=$(echo $DEVICE | awk '{print toupper($0)}')" >> $GITHUB_ENV
|
echo "strDevice=$(echo $DEVICE | awk '{print toupper($0)}')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
if [[ ${{ github.event.client_payload.device || github.event.inputs.device }} == *"r1s"* ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
rm -rf bin/
|
||||||
|
LUCI=$(echo `cat $GITHUB_WORKSPACE/$DEVICE.config.seed | grep CONFIG_PACKAGE | sed '/dnsmasq_full_dhcpv6/d;/INCLUDE/d;/docker/d' | grep luci-app | sed 's/CONFIG_PACKAGE_//;s/=y//'`)
|
||||||
|
LP=$(cd packages; echo $LUCI | sed 's/-app-/-i18n-/g;s/ /\n/g' | xargs -n1 -i sh -c 'ls {}-zh-cn* 2>/dev/null' | sed 's/zh-.*.ipk/zh-cn/' | xargs echo)
|
||||||
|
make image PACKAGES="$PACKAGES $LUCI $LP luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn" FILES="files"
|
||||||
|
mv $(ls -1 ./bin/targets/*/*/*img.gz | head -1) $GITHUB_WORKSPACE/release/$DEVICE.img.gz
|
||||||
|
cd $GITHUB_WORKSPACE/release/ && md5sum $DEVICE.img.gz > $DEVICE.img.gz.md5
|
||||||
|
gzip -dc $DEVICE.img.gz | md5sum | sed "s/-/$DEVICE.img/" > $DEVICE.img.md5
|
||||||
|
|
||||||
- name: Upload release asset
|
- name: Upload release asset
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user