Skip to content

Release 21.02

Release 21.02 #8

Workflow file for this run

name: Release 21.02
on:
push:
tags:
- 'v*'
repository_dispatch:
workflow_dispatch:
inputs:
sdk_version:
description: '编译SDK版本'
required: true
default: '21.02.7'
type: choice
options:
- 21.02.7
- 22.03.6
- 23.05.2
upload_artifact:
description: '是否上传到Artifact'
required: false
type: boolean
default: false
upload_release:
description: '是否上传到Release'
required: false
type: boolean
default: true
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: |
declare -A sdkMap=()
sdkMap["21.02.7"]="openwrt-sdk-21.02.7-x86-64_gcc-8.4.0_musl"
sdkMap["22.03.6"]="openwrt-sdk-22.03.6-x86-64_gcc-11.2.0_musl"
sdkMap["23.05.2"]="openwrt-sdk-23.05.2-x86-64_gcc-12.3.0_musl"
SDK=${sdkMap["${{ inputs.sdk_version }}"]}
echo "USE SDK=$SDK"
wget https://archive.openwrt.org/releases/${{ inputs.sdk_version }}/targets/x86/64/$SDK.Linux-x86_64.tar.xz
xz -d $SDK.Linux-x86_64.tar.xz
tar -xf $SDK.Linux-x86_64.tar
mv $SDK.Linux-x86_64 openwrt-sdk
- name: Build
id: build
run: |
cd openwrt-sdk
git clone --depth=1 -b "${{ github.ref_name }}" https://github.com/gngpp/luci-theme-design.git package/luci-theme-design
./scripts/feeds update -a && ./scripts/feeds install -a
echo "CONFIG_PACKAGE_luci-theme-design=y" >> .config
make defconfig
make package/luci-theme-design/compile V=s -j$(nproc)
TARGET="$(find bin/ | grep luci-theme-design)"
echo "TARGET=$(pwd)/$TARGET"
echo "TARGET=$(pwd)/$TARGET" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT
- name : Upload to artifact
uses: actions/upload-artifact@master
if: steps.build.outputs.status == 'success' && github.event.inputs.upload_artifact == 'true' && !cancelled()
with:
name: luci-theme-design-${{ inputs.sdk_version }}
path: ${{ steps.build.outputs.TARGET }}
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
if: steps.build.outputs.status == 'success' && github.event.inputs.upload_release == 'true' && !cancelled()
with:
# Optionally strip `v` prefix
strip_v: false
- name: Upload to release
uses: softprops/action-gh-release@v1
if: steps.build.outputs.status == 'success' && github.event.inputs.upload_release == 'true' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
name: ${{ steps.tag.outputs.tag }}
tag_name: ${{ steps.tag.outputs.tag }}
prerelease: false
generate_release_notes: true
files: |
${{ steps.build.outputs.TARGET }}
LICENSE