mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
CI: multi-asset delivery support (#5243)
* fix: asset release broken fix: failed to upgrade helloworld
This commit is contained in:
parent
376abbc89e
commit
aed7fc6131
76
.github/workflows/openwrt-ci.yml
vendored
76
.github/workflows/openwrt-ci.yml
vendored
@ -1,29 +1,30 @@
|
|||||||
#
|
#
|
||||||
# This is free software, lisence use MIT.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2019 P3TERX <https://p3terx.com>
|
|
||||||
# Copyright (C) 2019 KFERMercer <KFER.Mercer@gmail.com>
|
|
||||||
#
|
|
||||||
# <https://github.com/KFERMercer/OpenWrt-CI>
|
# <https://github.com/KFERMercer/OpenWrt-CI>
|
||||||
#
|
#
|
||||||
|
# Copyright (C) 2019 P3TERX
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020 KFERMercer
|
||||||
|
#
|
||||||
name: OpenWrt-CI
|
name: OpenWrt-CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 20 * * *
|
- cron: 0 20 * * *
|
||||||
push:
|
release:
|
||||||
tags:
|
types: [published]
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build_openwrt:
|
build_openwrt:
|
||||||
|
|
||||||
name: Build OpenWrt and release
|
name: Build OpenWrt firmware
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: github.event.repository.owner.id == github.event.sender.id
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@ -35,7 +36,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker rmi `docker images -q`
|
docker rmi `docker images -q`
|
||||||
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d
|
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d
|
||||||
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
|
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php* android*
|
||||||
sudo -E apt-get update
|
sudo -E apt-get update
|
||||||
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf swig
|
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf swig
|
||||||
sudo -E apt-get -y autoremove --purge
|
sudo -E apt-get -y autoremove --purge
|
||||||
@ -45,7 +46,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Update feeds
|
- name: Update feeds
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/\"#src-git\"/\"src-git\"/g' ./feeds.conf.default
|
sed -i 's/#src-git helloworld/src-git helloworld/g' ./feeds.conf.default
|
||||||
./scripts/feeds update -a
|
./scripts/feeds update -a
|
||||||
./scripts/feeds install -a
|
./scripts/feeds install -a
|
||||||
|
|
||||||
@ -70,32 +71,39 @@ jobs:
|
|||||||
du -h --max-depth=1 ./bin
|
du -h --max-depth=1 ./bin
|
||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
run: find ./bin/targets/ -type d -name "packages" | xargs rm -rf {}
|
run: |
|
||||||
|
mkdir -p ./artifact/firmware
|
||||||
|
mkdir -p ./artifact/package
|
||||||
|
mkdir -p ./artifact/buildinfo
|
||||||
|
rm -rf $(find ./bin/targets/ -type d -name "packages")
|
||||||
|
cp -rf $(find ./bin/targets/ -type f) ./artifact/firmware/
|
||||||
|
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/
|
||||||
|
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Deliver buildinfo
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: OpenWrt_buildinfo
|
||||||
|
path: ./artifact/buildinfo/
|
||||||
|
|
||||||
|
- name: Deliver package
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: OpenWrt_package
|
||||||
|
path: ./artifact/package/
|
||||||
|
|
||||||
|
- name: Deliver firmware
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: OpenWrt_firmware
|
name: OpenWrt_firmware
|
||||||
path: ./bin/targets/
|
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
|
- name: Upload release asset
|
||||||
if: github.event == 'push'
|
if: github.event == 'release'
|
||||||
id: upload-release-asset
|
uses: svenstaro/upload-release-action@v2
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
repo_token: ${{ secrets.YOURTOKEN }}
|
||||||
asset_path: ./bin/targets/*/*/
|
file: ./artifact/firmware/*
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
file_glob: true
|
||||||
|
Loading…
Reference in New Issue
Block a user