From a178d32408c85fad94bea6a53070f4b182928d28 Mon Sep 17 00:00:00 2001 From: Ali Salimi <98024891+alisalimik@users.noreply.github.com> Date: Fri, 31 May 2024 11:41:10 +0330 Subject: [PATCH] Create build_android Signed-off-by: Ali Salimi <98024891+alisalimik@users.noreply.github.com> --- .github/workflows/build_android | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build_android diff --git a/.github/workflows/build_android b/.github/workflows/build_android new file mode 100644 index 00000000..325c2066 --- /dev/null +++ b/.github/workflows/build_android @@ -0,0 +1,49 @@ +name: Build GoMobile AAR + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + name: Build and Upload AAR + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' # Adjust to your Go version + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' + + - name: Install Android SDK + uses: android-actions/setup-android@v2 + with: + api-level: 30 + build-tools: 30.0.3 + + - name: Install GoMobile + run: | + go install golang.org/x/mobile/cmd/gomobile@latest + gomobile init + + - name: Build AAR with GoMobile + run: gomobile bind -target=android -o mylib.aar ./path/to/mylib + + - name: Upload AAR file + uses: actions/upload-artifact@v3 + with: + name: mylib-aar + path: mylib.aar