-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 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,70 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
release: | ||
name: Build and Release for ${{ matrix.arch }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- arch: x86_64 | ||
sdk_url_path: https://downloads.openwrt.org/snapshots/targets/x86/64 | ||
sdk_name: -sdk-x86-64_ | ||
|
||
env: | ||
PACKAGE_NAME: luci-app-autotimeset | ||
SDK_URL_PATH: ${{ matrix.sdk_url_path }} | ||
SDK_NAME: ${{ matrix.sdk_name }} | ||
ARCH: ${{ matrix.arch }} | ||
CACHE_DIR: ~/cache | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -yq gettext libncurses5-dev rsync xsltproc | ||
- name: Create Directories | ||
run: | | ||
echo "SDK_HOME=$(mktemp -d)" >> $GITHUB_ENV | ||
echo "SDK_DL_DIR=$(mktemp -d)" >> $GITHUB_ENV | ||
- name: Prepare Build Environment | ||
run: | | ||
cd "$SDK_DL_DIR" | ||
if ! ( wget -q -O - "$SDK_URL_PATH/sha256sums" | grep -- "$SDK_NAME" > sha256sums.small 2>/dev/null ) ; then | ||
echo "Can not find ${SDK_NAME} file in sha256sums." | ||
exit 1 | ||
fi | ||
SDK_FILE="$(cat sha256sums.small | cut -d' ' -f2 | sed 's/*//g')" | ||
wget -q -O "$SDK_FILE" "$SDK_URL_PATH/$SDK_FILE" | ||
if ! sha256sum -c ./sha256sums.small >/dev/null 2>&1 ; then | ||
echo "SDK can not be verified!" | ||
exit 1 | ||
fi | ||
tar -Jxf "$SDK_DL_DIR/$SDK_FILE" -C "$SDK_HOME" --strip=1 | ||
- name: Build Packages | ||
run: | | ||
cd "$SDK_HOME" | ||
./scripts/feeds update -a > /dev/null 2>&1 | ||
./scripts/feeds install golang > /dev/null 2>&1 | ||
ln -s "${{ github.workspace }}" "package/$PACKAGE_NAME" | ||
make defconfig > /dev/null 2>&1 | ||
make package/${PACKAGE_NAME}/{clean,download,compile} | ||
find "$SDK_HOME/bin" -type f -name "${PACKAGE_NAME}_*.ipk" \ | ||
-exec cp -f {} "${{ github.workspace }}" \; | ||
- name: Release and Upload Assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "*.ipk" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} |