mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-29 05:25:13 +08:00
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
name: LuCI Theme Aurora Build & Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
branches:
|
|
- master
|
|
- "feat/**"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: build luci-theme-aurora ${{ matrix.sdk }}
|
|
runs-on: ubuntu-latest
|
|
if: >-
|
|
github.event_name == 'workflow_dispatch' ||
|
|
github.ref_type == 'tag' ||
|
|
contains(github.event.head_commit.message, '[build]')
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
sdk: ["24.10.4", "25.12.5"]
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- id: slug
|
|
run: echo "ref=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT"
|
|
- id: build
|
|
uses: eamonxg/build-luci-package@v2
|
|
with:
|
|
sdk: ${{ matrix.sdk }}
|
|
packages: '[{"pkg":"luci-theme-aurora","path":"."}]'
|
|
- uses: actions/upload-artifact@v6
|
|
with:
|
|
name: luci-theme-aurora-${{ steps.slug.outputs.ref }}-${{ steps.build.outputs.pkg_type }}
|
|
path: out/*.[ai]pk
|
|
- uses: eamonxg/build-luci-package/release@v2
|
|
with:
|
|
name: luci-theme-aurora
|
|
files: out/*.[ai]pk
|
|
body_repo: eamonxg/assets
|
|
body_path: aurora/docs/theme/changelog/${{ github.ref_name }}.md
|
|
|
|
notify-feed:
|
|
name: notify openwrt-cloud
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.ref_type == 'tag'
|
|
steps:
|
|
- name: Dispatch feed rebuild
|
|
env:
|
|
GH_TOKEN: ${{ secrets.FEED_DISPATCH_TOKEN }}
|
|
run: |
|
|
if [ -z "$GH_TOKEN" ]; then
|
|
echo "::error::FEED_DISPATCH_TOKEN is not set, so openwrt-cloud was never told about this release."
|
|
echo "The feed only rebuilds ahead of its daily schedule on this dispatch — without it the tag" >&2
|
|
echo "ships to GitHub Releases but never reaches the feed. Create a fine-grained PAT" >&2
|
|
echo "scoped to eamonxg/openwrt-cloud with Contents: read and write, then store it as" >&2
|
|
echo "the FEED_DISPATCH_TOKEN secret in this repository." >&2
|
|
exit 1
|
|
fi
|
|
gh api repos/eamonxg/openwrt-cloud/dispatches \
|
|
-f event_type=package-released \
|
|
-f 'client_payload[repo]=${{ github.repository }}' \
|
|
-f 'client_payload[tag]=${{ github.ref_name }}'
|
|
|