Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

172 changes: 172 additions & 0 deletions .github/workflows/sdk-releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: SDK Releaser

on:
release:
types: [created]
# push:
# tags:
# - "v*"
workflow_dispatch:
inputs:
tag_name:
description: "Tag name for release (e.g., v3.8.4)"
required: true
type: string

jobs:
build-android:
runs-on: ubuntu-latest
env:
TAG_VERSION: ${{ github.event.inputs.tag_name || github.ref_name }}
PROJECT_NAME: ${{ github.event.repository.name }}
NDK_VERSION: "20.1.5948944" # NDK r20b
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_name || github.ref }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install NDK r20b
run: |
echo "Installing NDK r20b (version $NDK_VERSION)..."
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;$NDK_VERSION"

echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$NDK_VERSION" >> $GITHUB_ENV
echo "NDK_ROOT=$ANDROID_HOME/ndk/$NDK_VERSION" >> $GITHUB_ENV

if [ -d "$ANDROID_HOME/ndk/$NDK_VERSION" ]; then
echo "NDK r20b installed successfully"
ls -la $ANDROID_HOME/ndk/$NDK_VERSION
else
echo "NDK installation failed"
exit 1
fi

- name: Install gomobile
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/cmd/gobind@latest
# gomobile init

- name: Build Android AAR using Makefile
run: |
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$NDK_VERSION
export NDK_ROOT=$ANDROID_HOME/ndk/$NDK_VERSION

echo "Using NDK r20b: $ANDROID_NDK_HOME"
echo "Building Android AAR using make android..."
make android

- name: Create Android archive
run: |
archive_name="${PROJECT_NAME}_${TAG_VERSION}_Android_aar.zip"
zip $archive_name open_im_sdk.aar
echo "Created archive: $archive_name"

- name: Upload Android AAR to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag_name
with:
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }}
files: ${{ env.PROJECT_NAME }}_${{ env.TAG_VERSION }}_Android_aar.zip
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-ios:
runs-on: macos-latest
env:
TAG_VERSION: ${{ github.event.inputs.tag_name || github.ref_name }}
PROJECT_NAME: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_name || github.ref }}

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.23"

- name: Install gomobile
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/cmd/gobind@latest
gomobile init

- name: Build iOS xcframework
run: |
# gomobile bind -v -trimpath -ldflags="-s -w" \
# -o ./build/OpenIMCore.xcframework -target=ios \
# ./open_im_sdk/ ./open_im_sdk_callback/
make ios

- name: Create iOS archive
run: |
cd build
archive_name="${PROJECT_NAME}_${TAG_VERSION}_iOS_xcframework.zip"
zip -r ../$archive_name OpenIMCore.xcframework
echo "Created archive: $archive_name"

- name: Upload iOS xcframework to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag_name
with:
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }}
files: ${{ env.PROJECT_NAME }}_${{ env.TAG_VERSION }}_iOS_xcframework.zip
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-wasm:
runs-on: ubuntu-latest
env:
TAG_VERSION: ${{ github.event.inputs.tag_name || github.ref_name }}
PROJECT_NAME: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_name || github.ref }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- name: Install make and zip
run: sudo apt-get update && sudo apt-get install -y make zip

- name: Build WASM
run: |
cd wasm/cmd
make wasm

- name: Create WASM archive
run: |
cd wasm/cmd
archive_name="${PROJECT_NAME}_${TAG_VERSION}_JS_wasm.zip"
zip $archive_name openIM.wasm
echo "Created archive: $archive_name"

- name: Upload WASM files to Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag_name
with:
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }}
files: wasm/cmd/${{ env.PROJECT_NAME }}_${{ env.TAG_VERSION }}_JS_wasm.zip
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading