Merge pull request #109 from gngpp/fmt #132
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
repository_dispatch: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Initialization Environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
echo -e "Total CPU cores\t: $(nproc)" | |
cat /proc/cpuinfo | grep 'model name' | |
free -h | |
uname -a | |
[ -f /proc/version ] && cat /proc/version | |
[ -f /etc/issue.net ] && cat /etc/issue.net | |
[ -f /etc/issue ] && cat /etc/issue | |
ulimit -a | |
- name: Download SDK | |
run: | | |
wget https://downloads.openwrt.org/releases/18.06.2/targets/x86/64/openwrt-sdk-18.06.2-x86-64_gcc-7.3.0_musl.Linux-x86_64.tar.xz | |
xz -d openwrt-sdk-18.06.2-x86-64_gcc-7.3.0_musl.Linux-x86_64.tar.xz | |
tar -xf openwrt-sdk-18.06.2-x86-64_gcc-7.3.0_musl.Linux-x86_64.tar | |
mv openwrt-sdk-18.06.2-x86-64_gcc-7.3.0_musl.Linux-x86_64 openwrt-sdk | |
- name: Build | |
id: build | |
run: | | |
cd openwrt-sdk | |
#echo -n > feeds.conf.default | |
#echo "src-git packages https://github.com/coolsnowwolf/packages" >> feeds.conf.default | |
#echo "src-git luci https://github.com/coolsnowwolf/luci" >> feeds.conf.default | |
#echo "src-git routing https://github.com/coolsnowwolf/routing" >> feeds.conf.default | |
#echo "src-git telephony https://git.openwrt.org/feed/telephony.git" >> feeds.conf.default | |
git clone --depth=1 -b "${{ github.ref_name }}" https://github.com/gngpp/luci-theme-design.git package/luci-theme-design | |
git clone https://github.com/gngpp/luci-app-design-config.git package/luci-app-design-config | |
sudo apt update && sudo apt install minify | |
pushd package/luci-theme-design | |
echo "$(minify dev/style.css)" > htdocs/luci-static/design/css/style.css | |
echo "$(minify dev/script.js)" > htdocs/luci-static/design/js/script.js | |
echo "$(minify dev/design.js)" > htdocs/luci-static/design/js/design.js | |
popd | |
./scripts/feeds update -a && ./scripts/feeds install -a | |
echo "CONFIG_PACKAGE_luci-theme-design=y" >> .config | |
echo "CONFIG_PACKAGE_luci-app-design-config=y" >> .config | |
make defconfig | |
make package/luci-theme-design/compile -j$(nproc) | |
make package/luci-app-design-config/compile -j$(nproc) | |
cd .. | |
TARGET="$(find openwrt-sdk/bin/ | grep luci-theme-design)" | |
CONFIG_TARGET="$(find openwrt-sdk/bin/ | grep luci-app-design-config)" | |
CONFIG_I18N_TARGET="$(find openwrt-sdk/bin/ | grep luci-i18n-design-config)" | |
echo 'JSON_RESPONSE<<EOF' >> $GITHUB_OUTPUT | |
echo "$TARGET" >> $GITHUB_OUTPUT | |
echo "$CONFIG_TARGET" >> $GITHUB_OUTPUT | |
echo "$CONFIG_I18N_TARGET" >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
echo "status=success" >> $GITHUB_OUTPUT | |
- name: Get tag | |
id: tag | |
uses: dawidd6/action-get-tag@v1 | |
with: | |
# Optionally strip `v` prefix | |
strip_v: false | |
- name: Upload to release | |
uses: softprops/action-gh-release@v1 | |
if: steps.build.outputs.status == 'success' && !cancelled() | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
name: ${{ steps.tag.outputs.tag }} | |
tag_name: ${{ steps.tag.outputs.tag }} | |
generate_release_notes: true | |
files: | | |
${{ steps.build.outputs.JSON_RESPONSE }} |