@@ -3,10 +3,25 @@ name: Build Theme Module
33on :
44 push :
55 branches : [ main ]
6+ tags :
7+ - ' v*'
68 workflow_dispatch :
9+ inputs :
10+ release_version :
11+ description : ' Release version, example: v0.1.1'
12+ required : false
13+ default : ' '
14+ publish_release :
15+ description : ' Create a public GitHub Release'
16+ required : true
17+ default : false
18+ type : boolean
719
820permissions :
9- contents : read
21+ contents : write
22+
23+ env :
24+ MODULE_ID : ColorOS-Themes-Rock
1025
1126jobs :
1227 build :
2035 - name : Install zip
2136 run : sudo apt-get update && sudo apt-get install -y zip
2237
38+ - name : Resolve release version
39+ shell : bash
40+ run : |
41+ if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
42+ VERSION="${GITHUB_REF_NAME}"
43+ elif [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ inputs.release_version }}" ]]; then
44+ VERSION="${{ inputs.release_version }}"
45+ else
46+ VERSION="$(grep -E '^version=' module.prop | head -n 1 | cut -d'=' -f2-)"
47+ fi
48+
49+ if [[ -z "$VERSION" ]]; then
50+ echo "Release version is empty" >&2
51+ exit 1
52+ fi
53+
54+ if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
55+ echo "Release version must look like v0.1.0" >&2
56+ exit 1
57+ fi
58+
59+ echo "MODULE_VERSION=$VERSION" >> "$GITHUB_ENV"
60+ echo "ZIP_NAME=${MODULE_ID}-${VERSION}.zip" >> "$GITHUB_ENV"
61+ echo "Resolved version: $VERSION"
62+
2363 - name : Validate module
2464 run : bash scripts/validate-module.sh
2565
3272 - name : Upload module artifact
3373 uses : actions/upload-artifact@v4
3474 with :
35- name : ColorOS-Themes-Rock
75+ name : ColorOS-Themes-Rock-${{ env.MODULE_VERSION }}
3676 path : dist/*.zip
3777 if-no-files-found : error
78+ retention-days : 30
79+
80+ - name : Generate release notes
81+ if : startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish_release)
82+ shell : bash
83+ run : |
84+ cat > RELEASE_NOTES.md <<EOF
85+ # ColorOS Themes Rock ${MODULE_VERSION}
86+
87+ Public module release for OPPO, OnePlus, and realme devices.
88+
89+ ## Included
90+ - Flashable module ZIP: ${ZIP_NAME}
91+ - OPPO / OnePlus / realme support structure
92+ - Theme asset folder support
93+ - Lock screen, home screen, wallpaper, and UI asset structure
94+ - Module validation before packaging
95+ - GitHub Actions automatic release build
96+
97+ ## Safety
98+ This module is for legal theme customization only. It does not bypass paid themes, DRM, protected OEM systems, or region locks.
99+
100+ ## Install
101+ 1. Download the ZIP from this release.
102+ 2. Open Magisk, KernelSU, or APatch.
103+ 3. Flash the module ZIP.
104+ 4. Reboot.
105+ 5. Test on one device first.
106+
107+ ## Build info
108+ - Commit: ${GITHUB_SHA}
109+ - Branch or tag: ${GITHUB_REF_NAME}
110+ EOF
111+
112+ - name : Publish public GitHub Release
113+ if : startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish_release)
114+ uses : softprops/action-gh-release@v2
115+ with :
116+ tag_name : ${{ env.MODULE_VERSION }}
117+ name : ColorOS Themes Rock ${{ env.MODULE_VERSION }}
118+ body_path : RELEASE_NOTES.md
119+ files : dist/*.zip
120+ draft : false
121+ prerelease : false
122+ fail_on_unmatched_files : true
0 commit comments