From 7e88e3ba4ffba4f5d57067aca6bcf65f71c878b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sun, 23 Jul 2023 03:23:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=BB=BABuild=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..b816f152 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,70 @@ +name: Build APK + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Java + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '17' + + - name: test + run: | + java --version + + - name: Setup Golang + uses: actions/setup-go@v2 + with: + go-version: '1.19.11' + + - name: Install gomobile + run: | + go install golang.org/x/mobile/cmd/gomobile@latest + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.48.0 + override: true + + - name: Setup Android environment + uses: android-actions/setup-android@v2 + with: + api-level: 30 + target-platform: 'x86_64' + + + - name: Build dependencies + run: | + mkdir ${{ github.workspace }}/build + cd ${{ github.workspace }}/build + git clone --depth=1 -b main https://github.com/2dust/AndroidLibXrayLite.git + cd AndroidLibXrayLite + gomobile init + go mod tidy -v + gomobile bind -v -androidapi 19 -ldflags='-s -w' ./ + cp *.aar ${{ github.workspace }}/V2rayNG/app/libs/ + + - name: Build APK + run: | + cd ${{ github.workspace }}/V2rayNG + chmod 777 * + sed -i 's/org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8/org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8/' ${{ github.workspace }}/V2rayNG/gradle.properties + ./gradlew assembleDebug + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: apk + path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/dev/debug/ \ No newline at end of file From 073c7c04100356611c972664d39b2bbc0c840443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sun, 23 Jul 2023 03:29:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b816f152..07db6e26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: Build APK on: + push: workflow_dispatch: jobs: From a5bb39ac8a8991dc20ee3b0d6d922b4a3a762a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sun, 23 Jul 2023 11:16:06 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=BC=96=E8=AF=91=E6=97=B6=E7=9A=84Xray=20co?= =?UTF-8?q?re=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and update sth --- .github/workflows/build.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07db6e26..a49c0d39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,11 @@ name: Build APK on: push: workflow_dispatch: + inputs: + XRAY_CORE_VERSION: + description: 'Xray core version or commit hash' + required: false + jobs: build: @@ -10,20 +15,16 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '17' - - name: test - run: | - java --version - - name: Setup Golang - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.19.11' @@ -52,6 +53,7 @@ jobs: cd ${{ github.workspace }}/build git clone --depth=1 -b main https://github.com/2dust/AndroidLibXrayLite.git cd AndroidLibXrayLite + go get github.com/xtls/xray-core@${{ github.event.inputs.XRAY_CORE_VERSION }} || true gomobile init go mod tidy -v gomobile bind -v -androidapi 19 -ldflags='-s -w' ./ @@ -65,7 +67,7 @@ jobs: ./gradlew assembleDebug - name: Upload APK - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: apk path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/dev/debug/ \ No newline at end of file From 775fa5ea625fa1470c301428688c90ca21ad901b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sat, 12 Aug 2023 00:54:19 +0800 Subject: [PATCH 4/5] update and remove unnecessary step --- .github/workflows/build.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a49c0d39..cd79bf83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,17 +34,8 @@ jobs: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - - name: Setup Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.48.0 - override: true - - name: Setup Android environment uses: android-actions/setup-android@v2 - with: - api-level: 30 - target-platform: 'x86_64' - name: Build dependencies From 71bd684b46a753d39a2cb19977a350db60d60f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= <45535409+Fangliding@users.noreply.github.com> Date: Fri, 8 Sep 2023 23:51:26 +0800 Subject: [PATCH 5/5] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd79bf83..28d1addb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,4 +61,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: apk - path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/dev/debug/ \ No newline at end of file + path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/debug/