我有一些用golang编写的代码,这些代码被编译为aar并通过gomobile在 android 应用程序中用作库。在我的 Windows 机器上一切正常,因为我已正确配置所有内容。现在我正在尝试使用 GitHub 操作自动化构建过程,但在使用 ubuntu 进行设置时遇到了问题。我遇到的问题我相信它们与在 ubuntu 上设置 PATH 有关。
这是我构建项目的工作流程
on:
push:
branches:
- main
- actions
name: "Build & Release"
jobs:
generate:
name: Generate codes
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.18'
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Installing go server dependencies
working-directory: server
run: |
go install
- name: setup-android-tools
uses: maxim-lobanov/setup-android-tools@v1
with:
packages: ndk;19.2.5345600
- name: Build aar
working-directory: server
run: |
go get -d golang.org/x/mobile/cmd/gomobile
gomobile init
gomobile bind -v -o ../client/app/libs/server.aar -target=android ./lib
- name: Push aar to release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ matrix.dir }}/client/app/libs/*aar"
tag: v1.0.${{ github.run_number }}
token: ${{ secrets.GITHUB_TOKEN }}
ibeautiful
相关分类