From c0af4c9f235103a77a90e28b4831fff9c5e8a956 Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify1@users.noreply.github.com> Date: Sun, 20 Aug 2023 09:17:10 +0000 Subject: [PATCH] new: add windows portable version --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++------------ Makefile | 7 +++++-- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a38bf631..17423d2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,29 +18,40 @@ jobs: - platform: android os: ubuntu-latest targets: aab,apk + target: android - platform: windows os: windows-latest aarch: amd64 targets: exe -# - platform: windows -# os: windows-latest -# aarch: 386 -# targets: exe + target: windows-x64 + - platform: windows + os: windows-latest + aarch: 386 + targets: exe + target: windows-x86 # - platform: linux # os: ubuntu-latest # aarch: 386 # targets: AppImage -# - platform: macos -# os: macos-11 -# aarch: amd64 -# targets: dmg + - platform: macos + os: macos-11 + aarch: universal + targets: dmg + - platform: linux os: ubuntu-latest aarch: amd64 targets: AppImage + target: linux-x64 + - platform: linux + os: ubuntu-latest + aarch: 386 + targets: AppImage + target: linux-x86 + runs-on: ${{ matrix.os }} steps: - name: checkout @@ -104,22 +115,24 @@ jobs: - name: Get Libs ${{ matrix.platform }} run: | - make ${{ matrix.platform }}-libs + make ${{ matrix.target }}-libs - - name: Release ${{ matrix.platform }} + - name: Release ${{ matrix.target }} run: | - make ${{ matrix.platform }}-release + make ${{ matrix.target }}-release - name: Copy to out WINDOWS if: matrix.platform == 'windows' run: | New-Item -ItemType Directory -Force -Name "out" - $EXT_ARRAY = "${{ matrix.targets }}" -split "," foreach ($EXT in $EXT_ARRAY) { # Find all files with this extension in the current directory, and copy them to "out" directory Get-ChildItem -Recurse -File -Filter "*setup.$EXT" | Copy-Item -Destination "out" -ErrorAction SilentlyContinue } + mkdir ${{ matrix.target }}-portable + copy build/windows/runner/Release ${{ matrix.target }}-portable + Compress-Archive ${{ matrix.target }}-portable out\${{ matrix.target }}-portable.zip - name: Copy to out unix if: matrix.platform != 'windows' diff --git a/Makefile b/Makefile index a7cbd30b..ddc7ad8b 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ linux-libs: macos-libs: mkdir -p $(DESKTOP_OUT)/ &&\ - curl -L https://github.com/hiddify/hiddify-libclash/releases/latest/download/hiddify-clashlib-macos-amd64.so.gz | gunzip > $(DESKTOP_OUT)/libclash.dylib + curl -L $(LIBS_DOWNLOAD_URL)/hiddify-libcore-macos-universal.dylib.gz | gunzip > $(DESKTOP_OUT)/libcore.dylib get-geo-assets: curl -L https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db -o $(GEO_ASSETS_DIR)/geoip.db @@ -57,4 +57,7 @@ build-windows-libs: make -C libcore -f Makefile windows-amd64 && mv $(BINDIR)/hiddify-libcore-windows-amd64.dll $(DESKTOP_OUT)/libcore.dll build-linux-libs: - make -C libcore -f Makefile linux-amd64 && mv $(BINDIR)/hiddify-libcore-linux-amd64.dll $(DESKTOP_OUT)/libcore.so \ No newline at end of file + make -C libcore -f Makefile linux-amd64 && mv $(BINDIR)/hiddify-libcore-linux-amd64.dll $(DESKTOP_OUT)/libcore.so + +build-macos-libs: + make -C libcore -f Makefile macos-amd64 && mv $(BINDIR)/hiddify-libcore-macos-amd64.dylib $(DESKTOP_OUT)/libcore.dylib \ No newline at end of file