Skip to content

Commit

Permalink
Add the actions workflow for auto building.
Browse files Browse the repository at this point in the history
Signed-off-by: Van Waholtz <vanwaholtz@gmail.com>
  • Loading branch information
Van Waholtz committed Feb 5, 2020
1 parent b8e9e2b commit ff7773a
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 3 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI

on:
push:
branches:
- new-dev

jobs:
build:
name: Build the IPK
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@master
- name: Docker Build
run: |
mkdir bin
cp -rf ./luci-app-wrtbwmon ./bin/
docker pull openwrtorg/sdk:x86-64-19.07-SNAPSHOT
docker run --rm --name=test -u root -v "$(pwd)"/bin/:/home/build/openwrt/bin --privileged=true -d openwrtorg/sdk:x86-64-19.07-SNAPSHOT sleep 1d
docker exec -i test sed -i 's/git\.openwrt\.org\/project\/luci/github\.com\/openwrt\/luci/g' ./feeds.conf.default
docker exec -i test ./scripts/feeds update luci
docker exec -i test ./scripts/feeds install luci
docker exec -i test mv ./bin/luci-app-wrtbwmon ./package/
docker exec -i test make defconfig
docker exec -i test make package/luci-app-wrtbwmon/compile V=s -j$(nproc) | tee >./bin/build.log
docker stop test
- name: Pack Files
run: |
cd bin && tar -cJvf ../build.log.tar.xz build.log && cd ..
mkdir release
cp -f ./bin/packages/x86_64/base/*wrtbwmon* ./release/
echo "::set-env name=app_path::$(ls ./release/*app-wrtbwmon*)"
echo "::set-env name=i18n_path::$(ls ./release/*i18n-wrtbwmon*)"
- name: Upload app
uses: actions/upload-artifact@v1
with:
name: app
path: ${{ env.app_path }}
- name: Upload i18n
uses: actions/upload-artifact@v1
with:
name: i18n
path: ${{ env.i18n_path }}
- name: Upload Log
uses: actions/upload-artifact@v1
with:
name: buildlog
path: ./build.log.tar.xz
Release:
name: Release the Binary Files
needs: build
runs-on: ubuntu-18.04
steps:
- name: Download App Artifact
uses: actions/download-artifact@v1
with:
name: app
- name: Set app Env
run: |
echo "::set-env name=app_path::$(ls ./app/*.ipk)"
echo "::set-env name=app_name::$(basename `ls ./app/*.ipk`)"
- name: Download i18n Artifact
uses: actions/download-artifact@v1
with:
name: i18n
- name: Set i18n Env
run: |
echo "::set-env name=i18n_path::$(ls ./i18n/*.ipk)"
echo "::set-env name=i18n_name::$(basename `ls ./i18n/*.ipk`)"
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
target_commitish: master
body: |
Changes in this Release
- First Change
- Second Change
draft: true
prerelease: true
- name: Upload App Release
id: upload-app-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.app_path }}
asset_name: ${{ env.app_name }}
asset_content_type: application/gzip
- name: Upload i18n Release
id: upload-i18n-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.i18n_path }}
asset_name: ${{ env.i18n_name }}
asset_content_type: application/gzip

6 changes: 3 additions & 3 deletions Makefile → luci-app-wrtbwmon/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2017 Georgios Tzourmpakis <kiougar@gmail.com>
# Copyright (C) 2019 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
Expand All @@ -11,12 +11,12 @@ PKG_VERSION:=1.6.3
PKG_RELEASE:=1

PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=Georgios Tzourmpakis <kiougar@gmail.com>
PKG_MAINTAINER:=

LUCI_TITLE:=A Luci module that uses wrtbwmon to track bandwidth usage
LUCI_DEPENDS:=+wrtbwmon
LUCI_PKGARCH:=all

include ../../luci.mk
include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ff7773a

Please sign in to comment.