Skip to content

Commit 6a0f2de

Browse files
committed
Update build-android.yml
1 parent 947ae3a commit 6a0f2de

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

.github/workflows/build-android.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
gomobile init
3030
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
3131
32-
- name: Install gomobile
32+
- name: Install gomobile bind
3333
run: go get golang.org/x/mobile/bind@latest
3434

3535
- name: Create build directory
@@ -38,25 +38,19 @@ jobs:
3838
- name: Build mobile package
3939
run: |
4040
gomobile bind -v -o ./build/mobile.aar -target=android -ldflags="-checklinkname=0" -androidapi 26 ./mobile
41+
4142
- name: Set up JDK 11
42-
uses: actions/setup-java@v2
43+
uses: actions/setup-java@v4
4344
with:
44-
java-version: '11' # Specify the Java version
45-
distribution: 'adopt'
46-
- name: Install Android SDK
47-
run: |
48-
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
49-
unzip commandlinetools-linux-6609375_latest.zip -d $HOME/android-sdk
50-
mkdir -p $HOME/android-sdk/cmdline-tools/latest
51-
mv $HOME/android-sdk/cmdline-tools/bin $HOME/android-sdk/cmdline-tools/latest/
52-
mv $HOME/android-sdk/cmdline-tools/lib $HOME/android-sdk/cmdline-tools/latest/
53-
echo "ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV
54-
echo "$HOME/android-sdk/cmdline-tools/latest/bin" >> $GITHUB_PATH
55-
yes | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses
56-
$HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-31" "build-tools;31.0.3"
45+
java-version: '11'
46+
distribution: 'temurin'
47+
48+
- name: Set up Android SDK
49+
uses: android-actions/setup-android@v3
50+
5751
- name: Get Release Info
5852
id: get-release-info
59-
uses: actions/github-script@v5
53+
uses: actions/github-script@v7
6054
with:
6155
script: |
6256
let releaseVersion = '0.0.0';
@@ -70,7 +64,8 @@ jobs:
7064
console.log('Error fetching latest release: ', error.message);
7165
}
7266
return releaseVersion;
73-
- name: Print release
67+
68+
- name: Print release
7469
run: echo "Latest Release is ${{ steps.get-release-info.outputs.result }}"
7570

7671
- name: Install package with Maven
@@ -84,7 +79,6 @@ jobs:
8479
cp ./.github/pom.xml ./build/pom.xml
8580
cp ./.github/AndroidManifest.xml ./build/src/main/AndroidManifest.xml
8681
87-
8882
- name: Prepare for Maven deployment
8983
run: |
9084
sed -i "s/\${release_version}/${{ steps.get-release-info.outputs.result }}/g" build/pom.xml
@@ -95,4 +89,3 @@ jobs:
9589
mvn deploy -Drelease_version=${{ steps.get-release-info.outputs.result }}
9690
env:
9791
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-

0 commit comments

Comments
 (0)