Skip to content

webui/locales: add Chinese (traditional, TW) translation (#39) #134

webui/locales: add Chinese (traditional, TW) translation (#39)

webui/locales: add Chinese (traditional, TW) translation (#39) #134

Workflow file for this run

name: Build
on:
push:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
env:
MODULE_NAME: 'KPatch-Next-Module'
GH_TOKEN: ${{ github.token }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_vars.outputs.version }}
check_tag: ${{ steps.check_tag.outputs.need_release }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: download kpatch-next binaries (latest release)
run: |
mkdir -p module/bin
gh release download -R KernelSU-Next/KPatch-Next -p "kpatch-android" -p "kptools-android" -p "kpimg-linux" -D module/bin
mv module/bin/kpatch-android module/bin/kpatch
mv module/bin/kptools-android module/bin/kptools
mv module/bin/kpimg-linux module/bin/kpimg
- name: Download magiskboot binary
run: |
TAG=$(gh release list -R topjohnwu/Magisk -L 1 --json tagName --jq '.[0].tagName')
gh release download "$TAG" -R topjohnwu/Magisk -p "Magisk*.apk" -O magisk.apk
unzip -p magisk.apk 'lib/arm64-v8a/libmagiskboot.so' > module/bin/magiskboot
rm magisk.apk
- name: build webroot
run: |
cd webui
npm ci
npm run build
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.MODULE_NAME }}-${{ github.run_number }}
path: 'module'
- name: Check if valid to release
id: check_tag
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "need_release=false" >> $GITHUB_OUTPUT
else
git fetch --tags
VERSION="$(jq -r .version update.json)"
if [ -z "$VERSION" ]; then
echo "need_release=false" >> $GITHUB_OUTPUT
elif git tag | grep -qx "^${VERSION}"; then
echo "need_release=false" >> $GITHUB_OUTPUT
else
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "need_release=true" >> $GITHUB_OUTPUT
fi
fi
release:
runs-on: ubuntu-latest
needs: build
if: needs.release.outputs.check_tag == 'true'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.MODULE_NAME }}-${{ github.run_number }}
path: ${{ env.MODULE_NAME }}
- name: Zip for release
run: cd ${{ env.MODULE_NAME }} && zip -r ../${{ env.MODULE_NAME }}.zip .
- name: Generate changelog
run: |
CHANGELOG_RAW=$(git diff HEAD^ HEAD -- "CHANGELOG.md" | grep '^+[^+]' | sed 's/^+//')
{
echo "CHANGELOG<<EOF"
echo -e "${CHANGELOG_RAW}"
echo "EOF"
} >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release.outputs.version }}
name: ${{ needs.release.outputs.version }}
body: ${{ env.CHANGELOG }}
files: ${{ env.MODULE_NAME }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}