|
|
@@ -14,7 +14,7 @@ on:
|
|
|
- Action
|
|
|
- Pre-Release
|
|
|
- Release
|
|
|
- default: Actions
|
|
|
+ default: Action
|
|
|
kernel_build_version:
|
|
|
description: "Kernel Version"
|
|
|
type: choice
|
|
|
@@ -196,9 +196,106 @@ jobs:
|
|
|
path: AIO-REJ.zip
|
|
|
if-no-files-found: ignore
|
|
|
|
|
|
+ release-preview:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ if: ${{ always() && github.event_name == 'workflow_dispatch' }}
|
|
|
+ permissions:
|
|
|
+ contents: read
|
|
|
+ needs:
|
|
|
+ - build-android12-5-10
|
|
|
+ - build-android13-5-10
|
|
|
+ - build-android13-5-15
|
|
|
+ - build-android14-5-15
|
|
|
+ - build-android14-6-1
|
|
|
+ - build-android15-6-6
|
|
|
+ - build-android16-6-12
|
|
|
+
|
|
|
+ env:
|
|
|
+ GH_TOKEN: ${{ github.token }}
|
|
|
+ RELEASE_CONFIG: .github/config/release.json
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - name: Checkout code
|
|
|
+ uses: actions/checkout@v5
|
|
|
+
|
|
|
+ - name: Load Release Config
|
|
|
+ id: release_meta
|
|
|
+ run: |
|
|
|
+ set -euo pipefail
|
|
|
+
|
|
|
+ release_title=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["release"]["title"])' "$RELEASE_CONFIG")
|
|
|
+ echo "release_title=$release_title" >> "$GITHUB_OUTPUT"
|
|
|
+
|
|
|
+ - name: Extract KernelSU Version Info
|
|
|
+ id: ksu_version
|
|
|
+ env:
|
|
|
+ RELEASE_CONFIG_PATH: ${{ env.RELEASE_CONFIG }}
|
|
|
+ run: |
|
|
|
+ set -euo pipefail
|
|
|
+
|
|
|
+ # Extract KernelSU commit and branch from release config
|
|
|
+ KSUN_COMMIT=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["kernelsu"]["dev"])' "$RELEASE_CONFIG_PATH")
|
|
|
+ KSUN_BRANCH=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print("dev")' "$RELEASE_CONFIG_PATH")
|
|
|
+
|
|
|
+ # Clone KernelSU-Next on the specified branch
|
|
|
+ echo "Cloning KernelSU-Next from branch: $KSUN_BRANCH"
|
|
|
+ git clone --depth=1 --branch "$KSUN_BRANCH" https://github.com/KernelSU-Next/KernelSU-Next.git /tmp/kernelsu-next
|
|
|
+
|
|
|
+ cd /tmp/kernelsu-next
|
|
|
+
|
|
|
+ # Checkout the specific commit
|
|
|
+ echo "Checking out commit: $KSUN_COMMIT"
|
|
|
+ git fetch --depth=50 origin "$KSUN_COMMIT"
|
|
|
+ git checkout "$KSUN_COMMIT"
|
|
|
+
|
|
|
+ # Extract version info
|
|
|
+ COMMITS_COUNT=$(git rev-list --count HEAD)
|
|
|
+ BASE_VERSION=30000
|
|
|
+ KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
|
|
|
+
|
|
|
+ # Extract git tag
|
|
|
+ KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "no-tag")
|
|
|
+
|
|
|
+ MANAGER_RUN_ID=$(curl -fsSL "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?head_sha=${KSUN_COMMIT}" | jq -r '.workflow_runs[0].id // empty')
|
|
|
+ if [[ -n "${MANAGER_RUN_ID:-}" ]]; then
|
|
|
+ KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/runs/${MANAGER_RUN_ID}"
|
|
|
+ else
|
|
|
+ KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml"
|
|
|
+ fi
|
|
|
+
|
|
|
+ echo "Commits count: $COMMITS_COUNT"
|
|
|
+ echo "KSU Version: $KSU_VERSION"
|
|
|
+ echo "KSU Git Tag: $KSU_GIT_TAG"
|
|
|
+ echo "KSU Manager: $KSU_MANAGER"
|
|
|
+
|
|
|
+ # Export as environment for next step
|
|
|
+ echo "KSUN_BRANCH=$KSUN_BRANCH" >> $GITHUB_ENV
|
|
|
+ echo "KSUN_COMMIT=$KSUN_COMMIT" >> $GITHUB_ENV
|
|
|
+ echo "KSU_COMMITS_COUNT=$COMMITS_COUNT" >> $GITHUB_ENV
|
|
|
+ echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
|
|
|
+ echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
|
|
|
+ echo "KSU_MANAGER=$KSU_MANAGER" >> $GITHUB_ENV
|
|
|
+
|
|
|
+ - name: Set release body
|
|
|
+ run: |
|
|
|
+ set -e
|
|
|
+
|
|
|
+ RELEASE_CONFIG_PATH="$RELEASE_CONFIG"
|
|
|
+ : > release_body.md
|
|
|
+
|
|
|
+ python3 .github/scripts/render_release_body.py "$RELEASE_CONFIG_PATH" > release_body.md
|
|
|
+
|
|
|
+ - name: Publish release notes preview
|
|
|
+ run: |
|
|
|
+ {
|
|
|
+ echo "## Release Notes Preview"
|
|
|
+ echo
|
|
|
+ cat release_body.md
|
|
|
+ } >> "$GITHUB_STEP_SUMMARY"
|
|
|
+
|
|
|
release:
|
|
|
runs-on: ubuntu-latest
|
|
|
- if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != 'Actions' }}
|
|
|
+ if: ${{ github.event_name == 'workflow_dispatch' && (inputs.release_type == 'Pre-Release' || inputs.release_type == 'Release') }}
|
|
|
permissions:
|
|
|
contents: write
|
|
|
needs:
|
|
|
@@ -306,8 +403,8 @@ jobs:
|
|
|
set -euo pipefail
|
|
|
|
|
|
# Extract KernelSU commit and branch from release config
|
|
|
- KSUN_COMMIT=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["components"]["kernelsu"]["commit"])' "$RELEASE_CONFIG_PATH")
|
|
|
- KSUN_BRANCH=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["components"]["kernelsu"]["branch"])' "$RELEASE_CONFIG_PATH")
|
|
|
+ KSUN_COMMIT=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["kernelsu"]["dev"])' "$RELEASE_CONFIG_PATH")
|
|
|
+ KSUN_BRANCH=$(python3 -c 'print("dev")')
|
|
|
|
|
|
# Clone KernelSU-Next on the specified branch
|
|
|
echo "Cloning KernelSU-Next from branch: $KSUN_BRANCH"
|
|
|
@@ -328,9 +425,17 @@ jobs:
|
|
|
# Extract git tag
|
|
|
KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "no-tag")
|
|
|
|
|
|
+ MANAGER_RUN_ID=$(curl -fsSL "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?head_sha=${KSUN_COMMIT}" | jq -r '.workflow_runs[0].id // empty')
|
|
|
+ if [[ -n "${MANAGER_RUN_ID:-}" ]]; then
|
|
|
+ KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/runs/${MANAGER_RUN_ID}"
|
|
|
+ else
|
|
|
+ KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml"
|
|
|
+ fi
|
|
|
+
|
|
|
echo "Commits count: $COMMITS_COUNT"
|
|
|
echo "KSU Version: $KSU_VERSION"
|
|
|
echo "KSU Git Tag: $KSU_GIT_TAG"
|
|
|
+ echo "KSU Manager: $KSU_MANAGER"
|
|
|
|
|
|
# Export as environment for next step
|
|
|
echo "KSUN_BRANCH=$KSUN_BRANCH" >> $GITHUB_ENV
|
|
|
@@ -338,6 +443,7 @@ jobs:
|
|
|
echo "KSU_COMMITS_COUNT=$COMMITS_COUNT" >> $GITHUB_ENV
|
|
|
echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
|
|
|
echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
|
|
|
+ echo "KSU_MANAGER=$KSU_MANAGER" >> $GITHUB_ENV
|
|
|
|
|
|
- name: Set release body
|
|
|
run: |
|
|
|
@@ -348,25 +454,12 @@ jobs:
|
|
|
|
|
|
python3 .github/scripts/render_release_body.py "$RELEASE_CONFIG_PATH" > release_body.md
|
|
|
|
|
|
- - name: Workflow Summary
|
|
|
- if: ${{ always() }}
|
|
|
+ - name: Publish release notes preview
|
|
|
run: |
|
|
|
- set -e
|
|
|
-
|
|
|
- AK3_COMMIT="gki-2.0"
|
|
|
- PATCHES_COMMIT="main"
|
|
|
- BBG_COMMIT="main"
|
|
|
-
|
|
|
- short() { echo "${1:0:8}"; }
|
|
|
-
|
|
|
{
|
|
|
- echo "## 📦 Components"
|
|
|
- echo "| Component | Branch / Tag | Commit / Version |"
|
|
|
- echo "|---|---|---|"
|
|
|
- echo "| KernelSU-Next | ${KSUN_BRANCH:-dev} | $(short "${KSUN_COMMIT}") / ${KSU_GIT_TAG:-no-tag} / ${KSU_VERSION:-unknown} |"
|
|
|
- echo "| AnyKernel3 | gki-2.0 | $(short "$AK3_COMMIT") |"
|
|
|
- echo "| Kernel Patches | main | $(short "$PATCHES_COMMIT") |"
|
|
|
- echo "| BBG | main | $(short "$BBG_COMMIT") |"
|
|
|
+ echo "## Release Notes Preview"
|
|
|
+ echo
|
|
|
+ cat release_body.md
|
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
|
|
- name: Download AnyKernel3 Artifacts
|
|
|
@@ -376,13 +469,6 @@ jobs:
|
|
|
pattern: '*-AnyKernel3'
|
|
|
merge-multiple: false
|
|
|
|
|
|
- - name: Download Boot Image Artifacts
|
|
|
- uses: actions/download-artifact@v7
|
|
|
- with:
|
|
|
- path: release-assets
|
|
|
- pattern: '*-BootImages'
|
|
|
- merge-multiple: false
|
|
|
-
|
|
|
- name: Zip AnyKernel3 for Release
|
|
|
run: |
|
|
|
set -e
|