From ce326f078bede954be9ade6811409acca77b29e5 Mon Sep 17 00:00:00 2001 From: ZhenYu Date: Fri, 10 Apr 2020 00:43:01 +0800 Subject: [PATCH] Update openwrt-ci.yml (#4254) --- .github/workflows/openwrt-ci.yml | 45 ++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/openwrt-ci.yml b/.github/workflows/openwrt-ci.yml index 5ee6b7277..2e1641923 100644 --- a/.github/workflows/openwrt-ci.yml +++ b/.github/workflows/openwrt-ci.yml @@ -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/*/*/