Bump braces from 3.0.2 to 3.0.3 in /webui #101
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Makefile CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clone Submodules | |
run: git submodule update --init --recursive | |
- name: Set ENV | |
run: | | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
VERSION=$(cd Clash.Meta && git rev-parse --short HEAD) | |
BUILDTIME=$(date -u) | |
echo "TAGS=with_gvisor" >> $GITHUB_ENV | |
echo "buildSha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
echo "LDFLAGS=-X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}' -w -s -buildid=" >> $GITHUB_ENV | |
[ ! -f module/bin ] && mkdir module/bin | |
text="${{ github.event.head_commit.message }}" | |
echo "commit=$(echo $text | sed 's/\([][\\`.*^$\/+?{}()=!|:-]\)/\\\1/g')" >> $GITHUB_ENV | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
check-latest: true | |
- name: Setup Android NDK | |
uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r26b | |
add-to-path: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '21.6.2' | |
- name: Build WebUI | |
run: | | |
make build-webui | |
- name: Build Clash Meta - Arm64 | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run: | | |
cd Clash.Meta | |
CC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang | |
CGO_ENABLED=0 CC=${CC} GOARCH=arm64 GOOS=android go build -tags ${TAGS} -trimpath -ldflags "${LDFLAGS}" -o ../module/bin/clashMeta-android-arm64-v8a | |
cd ../module/bin && tar -vcjf clashMeta-android-arm64-v8a.tar.bz2 clashMeta-android-arm64-v8a && rm -rf clashMeta-android-arm64-v8a | |
- name: Pack Module Arm64 | |
run: | | |
make pack | |
mv akashaProxy.zip akashaProxy-arm64-${{ env.buildSha }}.zip | |
mkdir -p out/akashaProxy-arm64-${{ env.buildSha }} | |
cp -Rf module/* out/akashaProxy-arm64-${{ env.buildSha }}/ | |
- name: Upload Arm64 | |
uses: actions/upload-artifact@main | |
with: | |
name: akashaProxy-arm64-${{ env.buildSha }} | |
path: out/akashaProxy-arm64-${{ env.buildSha }} | |
- name: Build Clash Meta - Arm32 | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run: | | |
rm -rf ./module/bin | |
cd Clash.Meta | |
CC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi33-clang | |
CGO_ENABLED=0 CC=${CC} GOARCH=arm GOOS=android go build -tags ${TAGS} -trimpath -ldflags "${LDFLAGS}" -o ../module/bin/clashMeta-android-armeabi-v7a | |
cd ../module/bin && tar -vcjf clashMeta-android-armeabi-v7a.tar.bz2 clashMeta-android-armeabi-v7a && rm -rf clashMeta-android-armeabi-v7a | |
- name: Pack Module Arm32 | |
run: | | |
mkdir -p out/akashaProxy-arm32-${{ env.buildSha }} | |
cp -Rf module/* out/akashaProxy-arm32-${{ env.buildSha }}/ | |
- name: Upload Arm32 | |
uses: actions/upload-artifact@main | |
with: | |
name: akashaProxy-arm32-${{ env.buildSha }} | |
path: out/akashaProxy-arm32-${{ env.buildSha }} | |
- name: Build Clash Meta - x86_64 | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run: | | |
cd Clash.Meta | |
CC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android33-clang | |
CGO_ENABLED=0 CC=${CC} GOARCH=amd64 GOOS=linux go build -tags ${TAGS} -trimpath -ldflags "${LDFLAGS}" -o ../module/bin/clashMeta-android-x86_64 | |
cd ../module/bin && tar -vcjf clashMeta-android-x86_64.tar.bz2 clashMeta-android-x86_64 && rm -rf clashMeta-android-x86_64 | |
- name: Build Clash Meta - armAll | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
run: | | |
cd Clash.Meta | |
CC=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang | |
CGO_ENABLED=0 CC=${CC} GOARCH=arm64 GOOS=android go build -tags ${TAGS} -trimpath -ldflags "${LDFLAGS}" -o ../module/bin/clashMeta-android-arm64-v8a | |
cd ../module/bin && tar -vcjf clashMeta-android-arm64-v8a.tar.bz2 clashMeta-android-arm64-v8a && rm -rf clashMeta-android-arm64-v8a | |
- name: Pack Module armAll | |
run: | | |
mkdir -p out/akashaProxy-armAll-${{ env.buildSha }} | |
cp -Rf module/* out/akashaProxy-armAll-${{ env.buildSha }}/ | |
cd module && zip -r ../akashaProxy-armAll-${{ env.buildSha }}.zip * | |
- name: Upload armAll | |
uses: actions/upload-artifact@main | |
with: | |
name: akashaProxy-armAll-${{ env.buildSha }} | |
path: out/akashaProxy-armAll-${{ env.buildSha }} | |
- name: Find ZIP | |
run: | | |
echo "ZIP_FILE=$(find . -name 'akashaProxy-armAll-${{ env.buildSha }}.zip')" >> $GITHUB_ENV | |
- name: Post to Telegram Channel | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | |
env: | |
CHANNEL_ID: ${{ secrets.TELEGRAM_TO }} | |
BOT_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
FILE: ${{ env.ZIP_FILE }} | |
COMMIT_MESSAGE: |+ | |
**New push to github\!** | |
`${{ env.commit }}` | |
by ${{ github.event.head_commit.author.name }} | |
For more architecture see [action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | |
See commit detail [here](${{ github.event.head_commit.url }}) | |
run: | | |
ESCAPED=$(python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))') | |
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://release%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F release="@${FILE}" |