Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions 自动化编译 #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
on:
push:
branches:
- master
jobs:
create-release:
runs-on: ubuntu-18.04
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
id: ${{ steps.create-release.outputs.id }}
steps:
- id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_id }}
draft: true
build-package:
strategy:
matrix:
sdk-url:
- https://downloads.openwrt.org/releases/19.07.4/targets/pistachio/generic/openwrt-sdk-19.07.4-pistachio_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/oxnas/ox820/openwrt-sdk-19.07.4-oxnas-ox820_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ramips/rt3883/openwrt-sdk-19.07.4-ramips-rt3883_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ramips/rt288x/openwrt-sdk-19.07.4-ramips-rt288x_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/octeontx/generic/openwrt-sdk-19.07.4-octeontx_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/rb532/generic/openwrt-sdk-19.07.4-rb532_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ramips/mt76x8/openwrt-sdk-19.07.4-ramips-mt76x8_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ramips/rt305x/openwrt-sdk-19.07.4-ramips-rt305x_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ramips/mt7621/openwrt-sdk-19.07.4-ramips-mt7621_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ramips/mt7620/openwrt-sdk-19.07.4-ramips-mt7620_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mediatek/mt7623/openwrt-sdk-19.07.4-mediatek-mt7623_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mediatek/mt7622/openwrt-sdk-19.07.4-mediatek-mt7622_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ipq806x/generic/openwrt-sdk-19.07.4-ipq806x-generic_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/lantiq/xway_legacy/openwrt-sdk-19.07.4-lantiq-xway_legacy_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/lantiq/xway/openwrt-sdk-19.07.4-lantiq-xway_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/lantiq/xrx200/openwrt-sdk-19.07.4-lantiq-xrx200_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/lantiq/falcon/openwrt-sdk-19.07.4-lantiq-falcon_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/lantiq/ase/openwrt-sdk-19.07.4-lantiq-ase_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/kirkwood/generic/openwrt-sdk-19.07.4-kirkwood_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/omap/generic/openwrt-sdk-19.07.4-omap_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/layerscape/armv7/openwrt-sdk-19.07.4-layerscape-armv7_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/layerscape/armv8_64b/openwrt-sdk-19.07.4-layerscape-armv8_64b_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/malta/be/openwrt-sdk-19.07.4-malta-be_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mvebu/cortexa9/openwrt-sdk-19.07.4-mvebu-cortexa9_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mvebu/cortexa72/openwrt-sdk-19.07.4-mvebu-cortexa72_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/zynq/generic/openwrt-sdk-19.07.4-zynq_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/sunxi/cortexa8/openwrt-sdk-19.07.4-sunxi-cortexa8_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/tegra/generic/openwrt-sdk-19.07.4-tegra_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/sunxi/cortexa7/openwrt-sdk-19.07.4-sunxi-cortexa7_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/sunxi/cortexa53/openwrt-sdk-19.07.4-sunxi-cortexa53_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/samsung/s5pv210/openwrt-sdk-19.07.4-samsung-s5pv210_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/x86/legacy/openwrt-sdk-19.07.4-x86-legacy_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/x86/geode/openwrt-sdk-19.07.4-x86-geode_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mxs/generic/openwrt-sdk-19.07.4-mxs_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mvebu/cortexa53/openwrt-sdk-19.07.4-mvebu-cortexa53_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/x86/generic/openwrt-sdk-19.07.4-x86-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/x86/64/openwrt-sdk-19.07.4-x86-64_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/imx6/generic/openwrt-sdk-19.07.4-imx6_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/cns3xxx/generic/openwrt-sdk-19.07.4-cns3xxx_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/gemini/generic/openwrt-sdk-19.07.4-gemini_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm2708/bcm2708/openwrt-sdk-19.07.4-brcm2708-bcm2708_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm63xx/smp/openwrt-sdk-19.07.4-brcm63xx-smp_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm2708/bcm2709/openwrt-sdk-19.07.4-brcm2708-bcm2709_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm63xx/generic/openwrt-sdk-19.07.4-brcm63xx-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ath79/tiny/openwrt-sdk-19.07.4-ath79-tiny_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm47xx/legacy/openwrt-sdk-19.07.4-brcm47xx-legacy_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm47xx/mips74k/openwrt-sdk-19.07.4-brcm47xx-mips74k_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm2708/bcm2710/openwrt-sdk-19.07.4-brcm2708-bcm2710_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/bcm53xx/generic/openwrt-sdk-19.07.4-bcm53xx_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ath79/nand/openwrt-sdk-19.07.4-ath79-nand_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ar71xx/nand/openwrt-sdk-19.07.4-ar71xx-nand_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ath79/generic/openwrt-sdk-19.07.4-ath79-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ar71xx/tiny/openwrt-sdk-19.07.4-ar71xx-tiny_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ar71xx/mikrotik/openwrt-sdk-19.07.4-ar71xx-mikrotik_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ipq40xx/generic/openwrt-sdk-19.07.4-ipq40xx-generic_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ath25/generic/openwrt-sdk-19.07.4-ath25_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/armvirt/64/openwrt-sdk-19.07.4-armvirt-64_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/armvirt/32/openwrt-sdk-19.07.4-armvirt-32_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/ar71xx/generic/openwrt-sdk-19.07.4-ar71xx-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/at91/sam9x/openwrt-sdk-19.07.4-at91-sam9x_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/brcm47xx/generic/openwrt-sdk-19.07.4-brcm47xx-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/at91/sama5/openwrt-sdk-19.07.4-at91-sama5_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/apm821xx/sata/openwrt-sdk-19.07.4-apm821xx-sata_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mpc85xx/p2020/openwrt-sdk-19.07.4-mpc85xx-p2020_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mpc85xx/p1020/openwrt-sdk-19.07.4-mpc85xx-p1020_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/mpc85xx/generic/openwrt-sdk-19.07.4-mpc85xx-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/octeon/generic/openwrt-sdk-19.07.4-octeon_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/apm821xx/nand/openwrt-sdk-19.07.4-apm821xx-nand_gcc-7.5.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/arc770/generic/openwrt-sdk-19.07.4-arc770-generic_gcc-8.3.0_uClibc.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/19.07.4/targets/archs38/generic/openwrt-sdk-19.07.4-archs38-generic_gcc-8.3.0_uClibc.Linux-x86_64.tar.xz
runs-on: ubuntu-18.04
needs: create-release
steps:
- uses: actions/checkout@v2
- name: env
run: echo arch=$(echo ${{ matrix.sdk-url }} | sed -e 's/.*openwrt-sdk-19.07.4-\(.*\)_gcc.*/\1/') >> $GITHUB_ENV
- name: build
run: docker build --build-arg URL=${{ matrix.sdk-url }} -t ${{ env.arch }} .
- name: output
run: docker cp $(docker run -d ${{ env.arch }}):/output ./${{ env.arch }}
- name: release
run: zip -r ${{ env.arch }} ${{ env.arch }}
- name: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./${{ env.arch }}.zip
asset_name: ${{ env.arch }}.zip
asset_content_type: application/zip
publish-release:
name: publish-release
runs-on: ubuntu-18.04
needs:
- create-release
- build-package
steps:
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.create-release.outputs.id }}
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM debian:buster

# Init
SHELL ["/bin/bash", "-c"]
RUN apt-get update
RUN apt-get install -y curl wget xz-utils git build-essential libncurses5-dev gawk unzip python file

# Prepare sdk
WORKDIR /build
ARG URL
RUN curl -s -O $URL
RUN FILE="${URL##*/}" && tar xf "${FILE}" && mv "${FILE%.*.*}" sdk
ADD . /build/sdk/package/openwrt-vlmcsd/

# Config
WORKDIR /build/sdk
RUN make defconfig
RUN sed -i 's/CONFIG_PACKAGE_openwrt-vlmcsd=m/CONFIG_PACKAGE_openwrt-vlmcsd=y/g' .config

# Compile
RUN make package/openwrt-vlmcsd/compile V=99

# Output
WORKDIR /output
RUN mv `find /build/sdk/bin/packages/ | grep vlmcsd` .

ENTRYPOINT ["/bin/bash", "-c", "python3 -u -m http.server -b `awk 'END{print $1}' /etc/hosts` 80"]