Files
nanopi-openwrt-r1s-h3/.github/workflows/r2s_native-dev.yml_
2020-09-21 02:20:30 +08:00

87 lines
3.1 KiB
Plaintext

name: r2s原生固件(测试)
on:
push:
branches: [ master ]
paths:
- '.github/workflows/r2s_native-dev.yml'
schedule:
- cron: '10 08 * * *'
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'klever1988/nanopi-openwrt'
steps:
- name: Checkout
uses: actions/checkout@master
with:
ref: master
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: . 1_initialization_environment.sh
- name: Clone Source
run: |
git clone https://github.com/project-openwrt/openwrt --depth=1 -b openwrt-18.06-k5.4
#git clone https://github.com/openwrt/openwrt --depth=1 oopenwrt
#cd oopenwrt && echo 'package/boot/arm-trusted-firmware-rockchip
#package/boot/uboot-rockchip
#target/linux/rockchip
#package/base-files/files/lib/functions/system.sh' | xargs -n1 -i cp -a --parents {} ../openwrt/
- name: Setup Configuration
run: |
cd openwrt
echo 'CONFIG_TARGET_rockchip=y
CONFIG_TARGET_rockchip_armv8=y
CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2s=y
CONFIG_PACKAGE_kmod-rtl8821cu=y' > .config
cat ../base_rk3328.seed >> .config
cat ../minimal_config.seed >> .config
echo -e 'CONFIG_PACKAGE_kmod-mt7601u=y\n' >> .config
sed -i 's/option input\t\tREJECT/option input\t\tACCEPT/' package/network/config/firewall/files/firewall.config
echo -e '\nDYC Build\n' >> package/lean/default-settings/files/openwrt_banner
- name: Compile
run: |
cd openwrt
./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig
make download -j8
make -j$(($(nproc) + 1)) -s
- name: Assemble Artifact
id: assemble_artifact
run: |
#gzip openwrt/bin/targets/*/*/*img*
mv openwrt/bin/targets/*/*/*ext4*img.gz ./artifact.img.gz
release_tag="R2S-native-$(date +%Y-%m-%d)-dev"
echo "##[set-output name=release_tag;]$release_tag"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.sec_token }}
with:
tag_name: ${{ steps.assemble_artifact.outputs.release_tag }}
release_name: r2s原生测试 ${{ steps.assemble_artifact.outputs.release_tag }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.sec_token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./artifact.img.gz
asset_name: ${{ steps.assemble_artifact.outputs.release_tag }}-sd.img.gz
asset_content_type: application/gzip