diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..59ad1ef --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,51 @@ +name: Build + +on: + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Setup Golang + uses: actions/setup-go@v4 + with: + go-version: '1.21.4' + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Setup Android SDK Tools + uses: android-actions/setup-android@v3.2.0 + with: + cmdline-tools-version: 10406996 + + - name: Setup Android NDK + uses: nttld/setup-ndk@v1.4.2 + with: + ndk-version: 'r26b' + link-to-sdk: true + - name: Setup Go Mobile + run: | + go install golang.org/x/mobile/cmd/gomobile@latest + export PATH=$PATH:~/go/bin + + - name: Build + run: | + gomobile init + go mod tidy + gomobile bind -v -androidapi 19 -ldflags='-s -w' ./ + - name: Create zip file + run: | + zip AndroidLibV2rayLite.zip libv2ray.aar libv2ray-sources.jar + - name: Upload AndroidLibXrayLite to release + uses: svenstaro/upload-release-action@v2 + with: + file: ./libv2ray*r + tag: ${{ github.ref }} + file_glob: true