chore: fixed macos dylib id (#34) #92
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build GoMobile | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Version Overwrite | |
required: false | |
push: | |
tags: | |
- "v*" | |
pull_request: | |
env: | |
VERSION: ${{ github.event.inputs.version || (startsWith(github.ref, 'refs/tags/') && github.ref || '') }} | |
jobs: | |
android: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- uses: android-actions/setup-android@v2 | |
- name: Install Android Platform | |
run: | | |
sdkmanager "platform-tools" | |
sdkmanager "platforms;android-29" | |
sdkmanager "build-tools;29.0.2" | |
- uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r21d | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.21' | |
- name: Install Gomobile | |
run: | | |
go install golang.org/x/mobile/cmd/gomobile@latest | |
go install golang.org/x/mobile/cmd/gobind@latest | |
go get golang.org/x/mobile/cmd/gobind | |
go get golang.org/x/mobile/cmd/gomobile | |
gomobile init | |
env: | |
GOPROXY: https://proxy.golang.org,direct | |
GO111MODULE: "on" | |
- name: Build | |
run: make gomobile_android | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
ANDROID_NDK_TOOLCHAIN: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin | |
- name: Compress | |
run: tar -czvf output.tar.gz -C output/android . | |
- if: ${{ env.VERSION!='' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
asset_name: gomobile_openpgp_android_aar_$tag.tar.gz | |
file: output.tar.gz | |
tag: ${{ env.VERSION }} | |
overwrite: true | |
- if: ${{ env.VERSION=='' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gomobile_openpgp_android_aar | |
path: output.tar.gz | |
ios: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.21' | |
- name: Install Gomobile | |
run: | | |
go install golang.org/x/mobile/cmd/gomobile@latest | |
go install golang.org/x/mobile/cmd/gobind@latest | |
go get golang.org/x/mobile/cmd/gobind | |
go get golang.org/x/mobile/cmd/gomobile | |
gomobile init | |
env: | |
GOPROXY: https://proxy.golang.org,direct | |
GO111MODULE: "on" | |
- name: Build Framework | |
run: make gomobile_ios | |
- name: Compress Framework | |
run: tar -czvf output.tar.gz -C output/ios . | |
- if: ${{ env.VERSION!='' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
asset_name: gomobile_openpgp_ios_xcframework_$tag.tar.gz | |
file: output.tar.gz | |
tag: ${{ env.VERSION }} | |
overwrite: true | |
- if: ${{ env.VERSION=='' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gomobile_openpgp_ios_xcframework | |
path: output.tar.gz |