new: add ios core library to the project

This commit is contained in:
Hiddify
2023-10-24 11:26:21 +02:00
parent a22a5c088f
commit 45d3243d9e
3 changed files with 35 additions and 20 deletions

View File

@@ -4,12 +4,12 @@ on:
branches: branches:
- main - main
tags: tags:
- 'v*' - "v*"
paths-ignore: paths-ignore:
- '**.md' - "**.md"
- 'docs/**' - "docs/**"
- '.github/**' - ".github/**"
- '!.github/workflows/build.yml' - "!.github/workflows/build.yml"
pull_request: pull_request:
branches: branches:
- main - main
@@ -57,6 +57,7 @@ jobs:
# - platform: ios # - platform: ios
# os: macos-11 # os: macos-11
# aarch: universal # aarch: universal
# filename: hiddify-ios-universal
# targets: ipa # targets: ipa
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -67,15 +68,15 @@ jobs:
- name: Setup Flutter - name: Setup Flutter
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
flutter-version: '3.13.x' flutter-version: "3.13.x"
channel: 'stable' channel: "stable"
cache: true cache: true
- name: Setup Java - name: Setup Java
if: startsWith(matrix.platform,'android') if: startsWith(matrix.platform,'android')
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: 'zulu' distribution: "zulu"
java-version: 11 java-version: 11
- name: Setup NDK - name: Setup NDK
@@ -164,7 +165,7 @@ jobs:
xcopy /s /v '.\.github\help\mac-windows\' .\tmp_out\ xcopy /s /v '.\.github\help\mac-windows\' .\tmp_out\
cd tmp_out cd tmp_out
Compress-Archive .\ ..\out\hiddify-${{ matrix.platform }}-x64-setup.zip Compress-Archive -Path .\* -DestinationPath ..\out\hiddify-${{ matrix.platform }}-x64-setup.zip
cd .. cd ..
@@ -205,10 +206,13 @@ jobs:
else else
cp ./.github/help/mac-windows/* tmp_out/ cp ./.github/help/mac-windows/* tmp_out/
fi fi
if [[ "${{matrix.platform}}" == 'ios' ]];then
cd tmp_out mv tmp_out/${{matrix.filename}}.ipa bin/${{matrix.filename}}.ipa
7z a ${{matrix.filename}}.zip ./ else
mv *.zip ../out/ cd tmp_out
7z a ${{matrix.filename}}.zip ./
mv *.zip ../out/
fi
# - name: Copy to out unix # - name: Copy to out unix
# if: matrix.platform == 'linux' || matrix.platform == 'macos' || matrix.platform == 'ios' # if: matrix.platform == 'linux' || matrix.platform == 'macos' || matrix.platform == 'ios'
@@ -259,7 +263,7 @@ jobs:
uses: 8Mi-Tech/delete-release-assets-action@main uses: 8Mi-Tech/delete-release-assets-action@main
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
tag: 'draft' tag: "draft"
deleteOnlyFromDrafts: false deleteOnlyFromDrafts: false
- name: Create or Update Draft Release - name: Create or Update Draft Release
@@ -269,8 +273,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
files: ./out/* files: ./out/*
name: 'draft' name: "draft"
tag_name: 'draft' tag_name: "draft"
prerelease: true prerelease: true
upload-release: upload-release:
@@ -310,7 +314,7 @@ jobs:
with: with:
prerelease: ${{ env.CHANNEL == 'dev' }} prerelease: ${{ env.CHANNEL == 'dev' }}
tag_name: ${{ github.ref_name }} tag_name: ${{ github.ref_name }}
body_path: './release.md' body_path: "./release.md"
files: ./out/* files: ./out/*
- name: Create service_account.json - name: Create service_account.json
@@ -324,3 +328,11 @@ jobs:
releaseName: ${{ github.ref }} releaseName: ${{ github.ref }}
releaseFiles: ./hiddify-android-market.aab releaseFiles: ./hiddify-android-market.aab
track: internal track: internal
# - name: 'Upload app to TestFlight'
# uses: apple-actions/upload-testflight-build@v1
# with:
# app-path: './hiddify-ios-universal.ipa'
# issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
# api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
# api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}

View File

@@ -2,6 +2,7 @@ include dependencies.properties
BINDIR=./libcore/bin BINDIR=./libcore/bin
ANDROID_OUT=./android/app/libs ANDROID_OUT=./android/app/libs
IOS_OUT=./ios/Pods/Frameworks
DESKTOP_OUT=./libcore/bin DESKTOP_OUT=./libcore/bin
GEO_ASSETS_DIR=./assets/core GEO_ASSETS_DIR=./assets/core
@@ -78,7 +79,8 @@ macos-libs:
ios-libs: #not tested ios-libs: #not tested
mkdir -p $(DESKTOP_OUT)/ &&\ mkdir -p $(DESKTOP_OUT)/ &&\
curl -L $(CORE_URL)/$(CORE_NAME)-ios-universal.xcframework.gz | gunzip > $(DESKTOP_OUT)/libcore.xcframework curl -L $(CORE_URL)/$(CORE_NAME)-ios.xcframework.tar.gz | tar xz -C "$(IOS_OUT)" && \
mv $(IOS_OUT)/$(CORE_NAME)-ios.xcframework $(IOS_OUT)/libcore.xcframework
get-geo-assets: get-geo-assets:
curl -L https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db -o $(GEO_ASSETS_DIR)/geoip.db curl -L https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db -o $(GEO_ASSETS_DIR)/geoip.db
@@ -99,8 +101,9 @@ build-linux-libs:
build-macos-libs: build-macos-libs:
make -C libcore -f Makefile macos-universal && mv $(BINDIR)/$(CORE_NAME)-macos-universal.dylib $(DESKTOP_OUT)/libcore.dylib make -C libcore -f Makefile macos-universal && mv $(BINDIR)/$(CORE_NAME)-macos-universal.dylib $(DESKTOP_OUT)/libcore.dylib
build-ios-libs: #not tested build-ios-libs:
make -C libcore -f Makefile ios && mv $(BINDIR)/$(CORE_NAME)-ios.xcframework $(DESKTOP_OUT)/libcore.xcframework make -C libcore -f Makefile ios && mv $(BINDIR)/$(CORE_NAME)-ios.xcframework $(IOS_OUT)/libcore.xcframework
release: # Create a new tag for release. release: # Create a new tag for release.

0
ios/Pods/Frameworks/.gitkeep generated Normal file
View File