NekoX/.github/workflows/debug.yml

534 lines
20 KiB
YAML
Raw Permalink Normal View History

2021-02-18 03:32:07 +01:00
name: Debug build
on:
push:
branches:
2021-02-25 05:58:04 +01:00
- dev
2021-02-18 03:32:07 +01:00
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/debug.yml'
2021-02-18 06:29:01 +01:00
pull_request:
branches:
- dev
2021-07-26 21:09:14 +02:00
workflow_dispatch:
2021-08-08 16:15:03 +02:00
inputs:
artifacts:
description: 'y, if need artifacts'
required: false
2021-02-18 06:29:01 +01:00
2021-02-18 03:32:07 +01:00
jobs:
2021-02-25 05:58:04 +01:00
ffmpeg:
2021-03-05 06:38:05 +01:00
name: Native Build (FFmpeg)
2021-02-25 05:58:04 +01:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch Status
2022-02-04 04:49:46 +01:00
run: |
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
git submodule status TMessagesProj/jni/libvpx > libvpx_status
2021-02-25 05:58:04 +01:00
- name: FFmpeg Cache
id: cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/jni/ffmpeg/build
2022-02-04 04:49:46 +01:00
TMessagesProj/jni/libvpx/build
2022-03-13 16:27:52 +01:00
key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }}
2021-02-25 05:58:04 +01:00
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
if: steps.cache.outputs.cache-hit != 'true'
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
2021-03-26 03:01:53 +01:00
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
2021-02-25 05:58:04 +01:00
echo "sdk.dir=${ANDROID_HOME}" > local.properties
2021-03-26 03:01:53 +01:00
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
2022-02-04 04:49:46 +01:00
sudo apt-get install yasm -y
./run init libs libvpx
2021-02-25 05:58:04 +01:00
./run init libs ffmpeg
boringssl:
2021-03-05 06:38:05 +01:00
name: Native Build (BoringSSL)
2021-02-18 03:32:07 +01:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2021-02-25 05:58:04 +01:00
- name: Fetch Status
run: git submodule status TMessagesProj/jni/boringssl > boringssl_status
- name: BoringSSL Cache
id: cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/jni/boringssl/build
key: ${{ hashFiles('boringssl_status') }}
2021-02-18 03:32:07 +01:00
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
2021-02-25 05:58:04 +01:00
if: steps.cache.outputs.cache-hit != 'true'
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
2021-03-26 03:01:53 +01:00
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
2021-02-25 05:58:04 +01:00
echo "sdk.dir=${ANDROID_HOME}" > local.properties
2021-03-26 03:01:53 +01:00
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
./run init action boringssl
./run init libs boringssl
native:
2021-03-05 06:38:05 +01:00
name: Native Build (Telegram)
2021-02-25 05:58:04 +01:00
runs-on: ubuntu-latest
needs:
- ffmpeg
- boringssl
2021-03-31 21:29:44 +02:00
strategy:
matrix:
flavor:
- armeabi-v7a
- arm64-v8a
- x86
- x86_64
2021-02-25 05:58:04 +01:00
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch Status
run: |
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
2022-02-04 04:49:46 +01:00
git submodule status TMessagesProj/jni/libvpx > libvpx_status
2021-02-25 05:58:04 +01:00
git submodule status TMessagesProj/jni/boringssl > boringssl_status
2021-02-18 03:32:07 +01:00
- name: Native Cache
2021-02-25 05:58:04 +01:00
id: cache
uses: actions/cache@v2
2021-02-18 03:32:07 +01:00
with:
path: |
TMessagesProj/src/main/libs
2021-03-31 21:29:44 +02:00
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-${{ matrix.flavor }}
2021-02-25 05:58:04 +01:00
- name: Checkout Library
if: steps.cache.outputs.cache-hit != 'true'
run: |
git submodule update --init 'TMessagesProj/jni/*'
- name: FFmpeg Cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
TMessagesProj/jni/ffmpeg/build
2022-02-04 04:49:46 +01:00
TMessagesProj/jni/libvpx/build
2022-03-13 16:27:52 +01:00
key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }}
2021-02-25 05:58:04 +01:00
- name: BoringSSL Cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
TMessagesProj/jni/boringssl/build
key: ${{ hashFiles('boringssl_status') }}
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
if: steps.cache.outputs.cache-hit != 'true'
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
2021-03-26 03:01:53 +01:00
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
2021-02-25 05:58:04 +01:00
echo "sdk.dir=${ANDROID_HOME}" > local.properties
2021-03-26 03:01:53 +01:00
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Fix BoringSSL
2021-02-25 11:37:11 +01:00
if: steps.cache.outputs.cache-hit != 'true'
2021-02-18 03:32:07 +01:00
run: |
2021-02-25 05:58:04 +01:00
cd TMessagesProj/jni
./patch_boringssl.sh
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
2021-03-31 21:29:44 +02:00
export NATIVE_TARGET="${{ matrix.flavor }}"
2021-02-25 05:58:04 +01:00
./run libs native
v2ray:
2021-03-05 06:38:05 +01:00
name: Native Build (V2ray)
2021-02-25 05:58:04 +01:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2021-03-16 15:47:37 +01:00
- name: Fetch Status
run: git submodule status v2ray > v2ray_status
2021-02-25 05:58:04 +01:00
- name: V2ray Cache
id: cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/libv2ray.aar
2021-03-16 15:47:37 +01:00
key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }}
2021-02-25 05:58:04 +01:00
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
if: steps.cache.outputs.cache-hit != 'true'
2021-02-18 03:32:07 +01:00
- name: Install NDK
2021-02-25 05:58:04 +01:00
if: steps.cache.outputs.cache-hit != 'true'
2021-02-18 03:32:07 +01:00
run: |
2021-03-26 03:01:53 +01:00
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
2021-02-18 03:32:07 +01:00
echo "sdk.dir=${ANDROID_HOME}" > local.properties
2021-03-26 03:01:53 +01:00
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Install Golang
uses: actions/setup-go@v2
if: steps.cache.outputs.cache-hit != 'true'
2021-02-18 03:32:07 +01:00
with:
2021-03-05 16:09:24 +01:00
go-version: 1.16
2021-02-18 03:32:07 +01:00
- name: Native Build
2021-02-25 05:58:04 +01:00
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs v2ray
shadowsocks:
2021-03-05 06:38:05 +01:00
name: Native Build (Shadowsocks)
2021-02-25 05:58:04 +01:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch Status
run: git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status
- name: Shadowsocks Cache
id: cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/ss-rust-release.aar
key: ${{ hashFiles('shadowsocks_status') }}
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
if: steps.cache.outputs.cache-hit != 'true'
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
2021-03-26 03:01:53 +01:00
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
2021-02-25 05:58:04 +01:00
echo "sdk.dir=${ANDROID_HOME}" > local.properties
2021-03-26 03:01:53 +01:00
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Install Rust
if: steps.cache.outputs.cache-hit != 'true'
run: ./run init action shadowsocks
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs shadowsocks
shadowsocksr:
2021-03-05 06:38:05 +01:00
name: Native Build (ShadowsocksR)
2021-02-25 05:58:04 +01:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch Status
run: git submodule status 'ssr-libev/*' > shadowsocksr_status
- name: ShadowsocksR Cache
id: cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/ssr-libev-release.aar
key: ${{ hashFiles('shadowsocksr_status') }}
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
if: steps.cache.outputs.cache-hit != 'true'
- name: Install NDK
if: steps.cache.outputs.cache-hit != 'true'
2021-02-18 03:32:07 +01:00
run: |
2021-03-26 03:01:53 +01:00
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
2021-02-25 05:58:04 +01:00
echo "sdk.dir=${ANDROID_HOME}" > local.properties
2021-03-26 03:01:53 +01:00
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: ./run libs ssr
2021-02-28 15:37:30 +01:00
build:
name: Gradle Build
2021-02-18 03:32:07 +01:00
runs-on: ubuntu-latest
2021-02-25 05:58:04 +01:00
needs:
- native
- v2ray
- shadowsocks
- shadowsocksr
2021-02-18 03:32:07 +01:00
strategy:
matrix:
flavor:
- MiniRelease
- MiniReleaseNoGcm
2021-05-18 12:35:45 +02:00
- FullRelease
- FullReleaseNoGcm
2021-02-18 03:32:07 +01:00
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
2022-06-21 14:43:22 +02:00
- name: Install NDK
run: |
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
echo "sdk.dir=${ANDROID_HOME}" > local.properties
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-02-25 05:58:04 +01:00
- name: Fetch Status
run: |
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
git submodule status TMessagesProj/jni/boringssl > boringssl_status
git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status
git submodule status 'ssr-libev/*' > shadowsocksr_status
2021-03-16 15:47:37 +01:00
git submodule status v2ray > v2ray_status
2021-03-31 21:29:44 +02:00
- name: Native Cache (armeabi-v7a)
2021-02-25 05:58:04 +01:00
uses: actions/cache@v2
2021-02-18 03:32:07 +01:00
with:
path: |
TMessagesProj/src/main/libs
2021-03-31 21:29:44 +02:00
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a
- name: Native Cache (arm64-v8a)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a
- name: Native Cache (x86)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86
- name: Native Cache (x86_64)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86_64
2021-02-25 05:58:04 +01:00
- name: V2ray Cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/libv2ray.aar
2021-03-16 15:47:37 +01:00
key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }}
2021-02-25 05:58:04 +01:00
- name: Shadowsocks Cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/ss-rust-release.aar
key: ${{ hashFiles('shadowsocks_status') }}
- name: ShadowsocksR Cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/ssr-libev-release.aar
key: ${{ hashFiles('shadowsocksr_status') }}
2021-03-05 05:10:37 +01:00
- name: Configure Gradle
2021-02-18 03:32:07 +01:00
run: |
sed -i -e "s/16384/6144/g" gradle.properties
2021-03-05 05:10:37 +01:00
echo "sdk.dir=${ANDROID_HOME}" >> local.properties
2022-06-21 14:43:22 +02:00
# echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" >> local.properties
2021-02-18 03:32:07 +01:00
- name: Gradle cache
2021-02-25 05:58:04 +01:00
uses: actions/cache@v2
2021-02-18 03:32:07 +01:00
with:
path: ~/.gradle
key: gradle-${{ hashFiles('**/*.gradle') }}
- name: Debug Build
run: |
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
export DEBUG_BUILD=true
./gradlew TMessagesProj:assemble${{ matrix.flavor }}
2021-08-08 16:15:03 +02:00
echo "APK_FILE=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')" >> $GITHUB_ENV
echo "APK_FILE_ARMV7=$(find TMessagesProj/build/outputs/apk -name '*armeabi*.apk')" >> $GITHUB_ENV
echo "APK_FILE_X86=$(find TMessagesProj/build/outputs/apk -name '*x86-*.apk')" >> $GITHUB_ENV
echo "APK_FILE_X64=$(find TMessagesProj/build/outputs/apk -name '*x86_64*.apk')" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
if: github.event.inputs.artifacts == 'y'
name: Upload apk (arm64-v8a)
with:
name: NekoX-${{ matrix.flavor }}-arm64-v8a
path: ${{ env.APK_FILE }}
- uses: actions/upload-artifact@v2
if: github.event.inputs.artifacts == 'y'
name: Upload apk (armeabi-v7a)
with:
name: NekoX-${{ matrix.flavor }}-armeabi-v7a
path: ${{ env.APK_FILE_ARMV7 }}
- uses: actions/upload-artifact@v2
if: github.event.inputs.artifacts == 'y'
name: Upload apk (x86_64)
with:
name: NekoX-${{ matrix.flavor }}-x86_64
path: ${{ env.APK_FILE_X64 }}
- uses: actions/upload-artifact@v2
if: github.event.inputs.artifacts == 'y'
name: Upload apk (x86)
with:
name: NekoX-${{ matrix.flavor }}-x86
path: ${{ env.APK_FILE_X86 }}
2021-12-21 08:23:33 +01:00
build-dev:
name: Gradle Build
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' && success() }}
2021-12-21 08:23:33 +01:00
needs:
- native
- v2ray
- telegram-bot-api
2021-12-21 08:23:33 +01:00
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v2
2022-06-21 14:43:22 +02:00
- name: Install NDK
run: |
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.4.7075529" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
echo "sdk.dir=${ANDROID_HOME}" > local.properties
echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties
2021-12-21 08:23:33 +01:00
- name: Fetch Status
run: |
git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status
git submodule status TMessagesProj/jni/boringssl > boringssl_status
git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status
git submodule status 'ssr-libev/*' > shadowsocksr_status
git submodule status v2ray > v2ray_status
2022-12-02 10:18:18 +01:00
- name: Native Cache (armeabi-v7a)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a
2021-12-21 08:23:33 +01:00
- name: Native Cache (arm64-v8a)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a
2022-12-02 10:18:18 +01:00
- name: Native Cache (x86)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86
- name: Native Cache (x86_64)
uses: actions/cache@v2
with:
path: |
TMessagesProj/src/main/libs
key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-x86_64
2021-12-21 08:23:33 +01:00
- name: V2ray Cache
uses: actions/cache@v2
with:
path: |
TMessagesProj/libs/libv2ray.aar
key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }}
2022-12-02 19:03:28 +01:00
- name: Build Cache
uses: actions/cache@v3
with:
path: |
TMessagesProj/build
TMessagesProj/.cxx
ss-rust/build
ssr-rust/build
openpgp-api/build
key: build-cache
2021-12-21 08:23:33 +01:00
- name: Configure Gradle
run: |
sed -i -e "s/16384/6144/g" gradle.properties
echo "sdk.dir=${ANDROID_HOME}" >> local.properties
2022-06-21 14:43:22 +02:00
# echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" >> local.properties
2021-12-21 08:23:33 +01:00
- name: Gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle
key: gradle-${{ hashFiles('**/*.gradle') }}
- name: Download Telegram Bot API Binary
uses: actions/download-artifact@master
with:
name: telegram-bot-api-binary
path: .
- name: CI Build
2021-12-21 08:23:33 +01:00
run: |
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
export DEBUG_BUILD=true
export NATIVE_TARGET=universal
2021-12-21 08:23:33 +01:00
./gradlew TMessagesProj:assembleMiniRelease
APK=$(find TMessagesProj/build/outputs/apk/mini/release -name 'NekoX*.apk')
echo "APK=$APK" >> $GITHUB_ENV
VERSION_CODE=$(grep -E "def verCode = ([0-9]+)" TMessagesProj/build.gradle | sed "s/def verCode = //")
VERSION_NAME=$(grep -E "def verName = " TMessagesProj/build.gradle | sed "s/def verName = //" | sed "s/\"//g")
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
echo "VERSION_NAME=VERSION_NAME" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ci-apk
path: ${{ env.APK }}
upload:
name: Upload Apks to Telegram
runs-on: ubuntu-latest
needs:
- build-dev
- telegram-bot-api
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ci-apk
path: apks
- name: Download Telegram Bot API Binary
uses: actions/download-artifact@master
with:
name: telegram-bot-api-binary
path: .
- name: Install Python Environment
run: |
sudo apt install python3 python3-pip -y
pip3 install requests
2023-03-03 03:13:12 +01:00
- name: Prepare Upload
2021-12-21 08:23:33 +01:00
run: |
chmod +x telegram-bot-api-binary
2022-07-27 08:10:51 +02:00
function start() {
2023-03-03 03:13:12 +01:00
./telegram-bot-api-binary --api-id=21724 --api-hash=3e0cb5efcd52300aec5994fdfc5bdc16 -p 38118 --local 2>&1 > /dev/null &
sleep 5
2022-07-27 08:10:51 +02:00
}
start
2023-03-03 03:13:12 +01:00
curl http://127.0.0.1:38118/ || start
curl http://127.0.0.1:38118/ || start
curl http://127.0.0.1:38118/ || start
curl http://127.0.0.1:38118/ || start
- name: Upload
run: |
curl https://raw.githubusercontent.com/NekoX-Dev/NekoX/dev/.github/scripts/upload.py -o upload.py
2023-03-03 03:13:12 +01:00
export BOT_TOKEN="${{ secrets.HELPER_BOT_TOKEN }}"
export BOT_TARGET="${{ secrets.HELPER_BOT_TARGET }}"
export COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
2023-03-03 03:13:12 +01:00
python3 upload.py ci
pkill telegram-bot
telegram-bot-api:
name: Telegram Bot API
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clone Telegram Bot API
run: |
git clone --recursive https://github.com/tdlib/telegram-bot-api.git
git status telegram-bot-api >> telegram-bot-api-status
- name: Cache Bot API Binary
id: cache-bot-api
uses: actions/cache@v2
with:
path: telegram-bot-api-binary
key: CI-telegram-bot-api-${{ hashFiles('telegram-bot-api-status') }}
- name: Compile Telegram Bot API
if: steps.cache-bot-api.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install make git zlib1g-dev libssl-dev gperf cmake g++
cd telegram-bot-api
rm -rf build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. ..
cmake --build . --target install -j$(nproc)
cd ../..
ls -l telegram-bot-api/bin/telegram-bot-api*
cp telegram-bot-api/bin/telegram-bot-api telegram-bot-api-binary
- name: Upload Binary
uses: actions/upload-artifact@master
with:
name: telegram-bot-api-binary
path: telegram-bot-api-binary