Skip to content

[root] chore(release): bump update manifest to v1.0.5 (10005) #1

[root] chore(release): bump update manifest to v1.0.5 (10005)

[root] chore(release): bump update manifest to v1.0.5 (10005) #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag_name:
description: "Release tag (example: v1.0.4)"
required: true
type: string
release_name:
description: "Optional release title override"
required: false
type: string
prerelease:
description: "Mark as prerelease"
required: true
default: false
type: boolean
draft:
description: "Create as draft release"
required: true
default: false
type: boolean
permissions:
contents: write
concurrency:
group: release-${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: false
jobs:
release:
name: Build And Publish Release
runs-on: ubuntu-latest
env:
NDK_VERSION: "26.3.11579264"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve Release Metadata
id: meta
shell: bash
run: |
set -euo pipefail
prop() {
sed -n "s/^$1=//p" module.prop | head -n1
}
VERSION="$(prop version)"
VERSION_CODE="$(prop versionCode)"
MODULE_ID="$(prop id)"
MODULE_NAME="$(prop name)"
if [[ -z "${VERSION}" || -z "${VERSION_CODE}" || -z "${MODULE_ID}" || -z "${MODULE_NAME}" ]]; then
echo "::error::Failed to parse required keys from module.prop"
exit 1
fi
if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
TAG="${GITHUB_REF_NAME}"
PRERELEASE="false"
DRAFT="false"
RELEASE_NAME="Android Tweaker ${TAG}"
else
TAG="${{ inputs.tag_name }}"
PRERELEASE="${{ inputs.prerelease }}"
DRAFT="${{ inputs.draft }}"
RELEASE_NAME="${{ inputs.release_name }}"
if [[ -z "${RELEASE_NAME}" ]]; then
RELEASE_NAME="Android Tweaker ${TAG}"
fi
fi
if [[ "${TAG}" == v* ]]; then
TAG_VERSION="${TAG#v}"
if [[ "${TAG_VERSION}" != "${VERSION}" ]]; then
echo "::warning::Tag ${TAG} does not match module.prop version ${VERSION}"
fi
fi
echo "tag=${TAG}" >> "${GITHUB_OUTPUT}"
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
echo "version_code=${VERSION_CODE}" >> "${GITHUB_OUTPUT}"
echo "module_id=${MODULE_ID}" >> "${GITHUB_OUTPUT}"
echo "module_name=${MODULE_NAME}" >> "${GITHUB_OUTPUT}"
echo "release_name=${RELEASE_NAME}" >> "${GITHUB_OUTPUT}"
echo "prerelease=${PRERELEASE}" >> "${GITHUB_OUTPUT}"
echo "draft=${DRAFT}" >> "${GITHUB_OUTPUT}"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Build Dependencies
shell: bash
run: |
set -euo pipefail
yes | sdkmanager --licenses >/dev/null
sdkmanager "ndk;${NDK_VERSION}" "cmake;3.22.1"
- name: Build Native Binaries
shell: bash
run: |
set -euo pipefail
export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION}"
make rebuild
- name: Verify ABI Outputs
shell: bash
run: |
make verify
- name: Package Release Artifacts
id: package
shell: bash
run: |
set -euo pipefail
TAG="${{ steps.meta.outputs.tag }}"
VERSION="${{ steps.meta.outputs.version }}"
VERSION_CODE="${{ steps.meta.outputs.version_code }}"
MODULE_ID="${{ steps.meta.outputs.module_id }}"
ZIP_NAME="${MODULE_ID}-${VERSION}.zip"
ZIP_PATH="dist/${ZIP_NAME}"
make checksums TAG="${TAG}" REPO="${GITHUB_REPOSITORY}"
make update-json TAG="${TAG}" REPO="${GITHUB_REPOSITORY}"
echo "zip_name=${ZIP_NAME}" >> "${GITHUB_OUTPUT}"
echo "zip_path=${ZIP_PATH}" >> "${GITHUB_OUTPUT}"
- name: Generate Release Notes
shell: bash
run: |
TAG="${{ steps.meta.outputs.tag }}" REPO="${GITHUB_REPOSITORY}" make release-notes
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.tag }}
target_commitish: ${{ github.sha }}
name: ${{ steps.meta.outputs.release_name }}
body_path: dist/release-notes.md
draft: ${{ steps.meta.outputs.draft == 'true' }}
prerelease: ${{ steps.meta.outputs.prerelease == 'true' }}
files: |
${{ steps.package.outputs.zip_path }}
${{ steps.package.outputs.zip_path }}.sha256
dist/update.json
dist/andro-binaries.sha256
bin/arm64-v8a/andro
bin/armeabi-v7a/andro
bin/x86/andro
bin/x86_64/andro
- name: Upload Dist Artifact
uses: actions/upload-artifact@v4
with:
name: release-dist-${{ steps.meta.outputs.tag }}
path: dist/