Skip to content

Build Outlined Style #3

Build Outlined Style

Build Outlined Style #3

name: Build Outlined Style
permissions:
actions: read
contents: read
id-token: write
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
fg_color:
description: '前景色FG_COLOR (图标颜色, 例如 #d1e2fc)'
required: true
default: '#d1e2fc'
type: string
bg_color:
description: '背景色BG_COLOR (背景颜色, 例如 #1c232b)'
required: true
default: '#1c232b'
type: string
theme_name:
description: '颜色名称, 将包含在输出文件名中 (可选, 例如: dark_blue)'
required: false
default: ''
type: string
test_env:
description: '是否使用测试目录 (True/False)'
required: false
default: 'False'
type: choice
options:
- 'True'
- 'False'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
- name: Checkout LawnchairLauncher/lawnicons
uses: actions/checkout@v4
with:
repository: LawnchairLauncher/lawnicons
ref: develop
path: lawnicons-develop
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Prepare environment
run: pip install -r requirements.txt
- name: Build with Python
env:
FG_COLOR: ${{ github.event_name == 'workflow_dispatch' && inputs.fg_color || '#003a71' }}
BG_COLOR: ${{ github.event_name == 'workflow_dispatch' && inputs.bg_color || '#a1cafe' }}
THEME_NAME: ${{ github.event_name == 'workflow_dispatch' && inputs.theme_name || '' }}
TEST_ENV: ${{ github.event_name == 'workflow_dispatch' && inputs.test_env || 'False' }}
run: |
CMD="python build_outlined.py -fg \"$FG_COLOR\" -bg \"$BG_COLOR\""
if [ "${TEST_ENV,,}" = "true" ]; then
CMD="$CMD -test"
fi
eval $CMD
- name: Prepare artifact
if: success()
id: prepareArtifact
run: |
moduleName=`ls magisk_HyperMonetIcon*.zip | awk -F '.zip' '{print $1}'` && echo "moduleName=$moduleName" >> $GITHUB_OUTPUT
- name: Upload module
uses: actions/upload-artifact@v4
with:
name: ${{ steps.prepareArtifact.outputs.moduleName }}.zip
path: magisk_HyperMonetIcon*.zip
if-no-files-found: error
compression-level: 0
# - name: Upload mtz
# uses: actions/upload-artifact@v4
# with:
# name: ${{ steps.prepareArtifact.outputs.mtzName }}.mtz
# path: mtz_HyperMonetIcon*.mtz
# if-no-files-found: error
# compression-level: 0
# mtzName=`ls mtz_HyperMonetIcon*.mtz | awk -F '.mtz' '{print $1}'` && echo "mtzName=$mtzName" >> $GITHUB_OUTPUT