-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the actions workflow for auto building.
Signed-off-by: Van Waholtz <vanwaholtz@gmail.com>
- Loading branch information
Van Waholtz
committed
Feb 5, 2020
1 parent
b8e9e2b
commit ff7773a
Showing
8 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.