fix: ci
This commit is contained in:
1 parent
992973c818
commit
7eb33da28a
2 files changed
+84
No files matched your search
@@ -12,11 +12,82 @@ permissions:
|
|||||||
env:
|
env:
|
||||||
GO_VERSION: "1.26.4"
|
GO_VERSION: "1.26.4"
|
||||||
GORELEASER_VERSION: v2.15.4
|
GORELEASER_VERSION: v2.15.4
|
||||||
|
GOMOBILE_VERSION: latest
|
||||||
|
TASK_VERSION: 3.51.1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-ios:
|
||||||
|
name: Build iOS XCFramework
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v6.4.0
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- uses: arduino/setup-task@v2.0.0
|
||||||
|
with:
|
||||||
|
version: ${{ env.TASK_VERSION }}
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Install gomobile
|
||||||
|
run: |
|
||||||
|
go install golang.org/x/mobile/cmd/gomobile@${{ env.GOMOBILE_VERSION }}
|
||||||
|
gomobile init
|
||||||
|
|
||||||
|
- name: Build XCFramework
|
||||||
|
run: task build:ios
|
||||||
|
|
||||||
|
- name: Zip XCFramework
|
||||||
|
run: cd dist && zip -r Mobile.xcframework.zip Mobile.xcframework
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v7.0.1
|
||||||
|
with:
|
||||||
|
name: ios-xcframework-zip
|
||||||
|
path: dist/Mobile.xcframework.zip
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
build-android:
|
||||||
|
name: Build Android AAR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v6.4.0
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- uses: arduino/setup-task@v2.0.0
|
||||||
|
with:
|
||||||
|
version: ${{ env.TASK_VERSION }}
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Android NDK
|
||||||
|
run: |
|
||||||
|
NDK_DIR=$(ls -d $ANDROID_SDK_ROOT/ndk/*/ 2>/dev/null | sort -V | tail -n1)
|
||||||
|
echo "ANDROID_NDK_HOME=${NDK_DIR%/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install gomobile
|
||||||
|
run: |
|
||||||
|
go install golang.org/x/mobile/cmd/gomobile@${{ env.GOMOBILE_VERSION }}
|
||||||
|
gomobile init
|
||||||
|
|
||||||
|
- name: Build AAR
|
||||||
|
run: task build:android
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v7.0.1
|
||||||
|
with:
|
||||||
|
name: android-aar
|
||||||
|
path: dist/mobile.aar
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
goreleaser:
|
goreleaser:
|
||||||
name: GoReleaser
|
name: GoReleaser
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build-ios, build-android]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6.0.2
|
- uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
@@ -41,6 +112,16 @@ jobs:
|
|||||||
- name: Install syft (SBOM)
|
- name: Install syft (SBOM)
|
||||||
uses: anchore/sbom-action/download-syft@v0.24.0
|
uses: anchore/sbom-action/download-syft@v0.24.0
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v7.0.0
|
||||||
|
with:
|
||||||
|
name: ios-xcframework-zip
|
||||||
|
path: mobile-dist/
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v7.0.0
|
||||||
|
with:
|
||||||
|
name: android-aar
|
||||||
|
path: mobile-dist/
|
||||||
|
|
||||||
- uses: goreleaser/goreleaser-action@v7.2.2
|
- uses: goreleaser/goreleaser-action@v7.2.2
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
|
|||||||
@@ -149,6 +149,9 @@ release:
|
|||||||
mode: replace
|
mode: replace
|
||||||
draft: false
|
draft: false
|
||||||
name_template: "{{ .ProjectName }} {{ .Version }}"
|
name_template: "{{ .ProjectName }} {{ .Version }}"
|
||||||
|
extra_files:
|
||||||
|
- glob: mobile-dist/mobile.aar
|
||||||
|
- glob: mobile-dist/Mobile.xcframework.zip
|
||||||
|
|
||||||
dockers_v2:
|
dockers_v2:
|
||||||
- id: server
|
- id: server
|
||||||
|
|||||||
Reference in new issue
Block a user