Update openwrt-ci.yml (#4254)

This commit is contained in:
ZhenYu 2020-04-10 00:43:01 +08:00 committed by GitHub
parent 593d812a47
commit ce326f078b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,22 +12,22 @@ name: OpenWrt-CI
on:
schedule:
- cron: 0 20 * * *
watch:
types: started
push:
tags:
- '*'
jobs:
build:
build_openwrt:
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
name: Build OpenWrt and release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 1000000
- name: Space cleanup
env:
@ -41,15 +41,6 @@ jobs:
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
# 利用挂载在 /mnt/ 的 14G 额外空间:
# sudo mkdir -p -m 777 /mnt/openwrt/bin /mnt/openwrt/build_dir/host /mnt/openwrt/build_dir/hostpkg /mnt/openwrt/dl /mnt/openwrt/feeds /mnt/openwrt/staging_dir
# ln -s /mnt/openwrt/bin ./bin
# mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/host ./build_dir/host
# mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/hostpkg ./build_dir/hostpkg
# ln -s /mnt/openwrt/dl ./dl
# ln -s /mnt/openwrt/feeds ./feeds
# ln -s /mnt/openwrt/staging_dir ./staging_dir
df -h
- name: Update feeds
@ -85,3 +76,25 @@ jobs:
with:
name: OpenWrt_firmware
path: ./bin/targets/
- name: Create release
if: github.event == 'push'
id: create_release
uses: actions/create-release@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload release asset
if: github.event == 'push'
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/targets/*/*/