Update ci
This commit is contained in:
72
.github/workflows/release.yml
vendored
72
.github/workflows/release.yml
vendored
@@ -6,7 +6,8 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '.github/ISSUE_TEMPLATE/**'
|
- '.github/**'
|
||||||
|
- '!.github/workflows/release.yml'
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
@@ -15,12 +16,9 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
job:
|
job:
|
||||||
- { os: "ubuntu-latest", target: "android"}
|
- { os: "ubuntu-latest", target: "android"}
|
||||||
# - { os: "ubuntu-latest", target: "linux-386", aarch: 'x86'} #fultter does not support x86
|
|
||||||
- { os: "ubuntu-latest", target: "linux-amd64", aarch: 'x64'}
|
- { os: "ubuntu-latest", target: "linux-amd64", aarch: 'x64'}
|
||||||
# - { os: "ubuntu-latest", target: "windows-386", aarch: 'x86'} #fultter does not support x86
|
|
||||||
- { os: "ubuntu-latest", target: "windows-amd64", aarch: 'x64' }
|
- { os: "ubuntu-latest", target: "windows-amd64", aarch: 'x64' }
|
||||||
- { os: "macos-11", target: "macos-universal" }
|
- { os: "macos-11", target: "macos-universal" }
|
||||||
#- { os: "macos-11", target: "ios" }
|
|
||||||
runs-on: ${{ matrix.job.os }}
|
runs-on: ${{ matrix.job.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -28,33 +26,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up GCC
|
|
||||||
if: startsWith(matrix.job.target,'linux-386')
|
|
||||||
uses: egor-tensin/setup-gcc@v1
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
platform: ${{ matrix.job.aarch }}
|
|
||||||
|
|
||||||
- name: gcc
|
|
||||||
if: startsWith(matrix.job.target,'linux-386')
|
|
||||||
run: |
|
|
||||||
sudo apt-get install --reinstall libc6-dev
|
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version-file: 'go.mod'
|
go-version-file: 'go.mod'
|
||||||
check-latest: false
|
check-latest: false
|
||||||
|
|
||||||
# - name: Setup Golang caches
|
|
||||||
# uses: actions/cache@v3
|
|
||||||
# with:
|
|
||||||
# path: |
|
|
||||||
# ~/.cache/go-build
|
|
||||||
# ~/go/pkg/mod
|
|
||||||
# key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-golang-
|
|
||||||
|
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
if: startsWith(matrix.job.target,'android')
|
if: startsWith(matrix.job.target,'android')
|
||||||
@@ -62,7 +38,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
|
|
||||||
- name: Setup NDK
|
- name: Setup NDK
|
||||||
if: startsWith(matrix.job.target,'android')
|
if: startsWith(matrix.job.target,'android')
|
||||||
uses: nttld/setup-ndk@v1
|
uses: nttld/setup-ndk@v1
|
||||||
@@ -72,39 +48,28 @@ jobs:
|
|||||||
add-to-path: true
|
add-to-path: true
|
||||||
local-cache: true
|
local-cache: true
|
||||||
|
|
||||||
# - name: Setup Android SDK
|
|
||||||
# uses: amyu/setup-android@v2
|
|
||||||
# with:
|
|
||||||
# cache-disabled: true
|
|
||||||
# sdk-version: '33'
|
|
||||||
# ndk-version: '25.2.9519653'
|
|
||||||
|
|
||||||
#- name: Setup GoMobile
|
|
||||||
# if: startsWith(matrix.job.target,'android') || startsWith(matrix.job.target,'ios')
|
|
||||||
# run: make lib_install
|
|
||||||
|
|
||||||
- name: Setup MinGW
|
- name: Setup MinGW
|
||||||
if: startsWith(matrix.job.target,'windows')
|
if: startsWith(matrix.job.target,'windows')
|
||||||
uses: egor-tensin/setup-mingw@v2
|
uses: egor-tensin/setup-mingw@v2
|
||||||
with:
|
with:
|
||||||
platform: ${{ matrix.job.aarch }}
|
platform: ${{ matrix.job.aarch }}
|
||||||
|
|
||||||
- name: Set up macos
|
- name: Setup macos
|
||||||
if: startsWith(matrix.job.target,'macos') || startsWith(matrix.job.target,'ios')
|
if: startsWith(matrix.job.target,'macos') || startsWith(matrix.job.target,'ios')
|
||||||
run: |
|
run: |
|
||||||
brew install create-dmg tree coreutils
|
brew install create-dmg tree coreutils
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: make -j$(($(nproc) + 1)) ${{ matrix.job.target }}
|
run: |
|
||||||
|
make -j$(($(nproc) + 1)) ${{ matrix.job.target }}
|
||||||
|
|
||||||
- name: zip
|
- name: zip
|
||||||
run: |
|
run: |
|
||||||
tree
|
tree
|
||||||
rm -f ./bin/*.h
|
rm -f ./bin/*.h
|
||||||
rm ./bin/hiddify-libcore*sources* ||echo "no source"
|
rm ./bin/hiddify-libcore*sources* ||echo "no source"
|
||||||
rm ./bin/hiddify-libcore-macos-a*.dylib || echo "no macos arm and amd"
|
rm ./bin/hiddify-libcore-macos-a*.dylib || echo "no macos arm and amd"
|
||||||
gzip -r -S ".gz" ./bin/hiddify-libcore*
|
gzip -r -S ".gz" ./bin/hiddify-libcore*
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: ${{ success() }}
|
if: ${{ success() }}
|
||||||
@@ -112,16 +77,6 @@ jobs:
|
|||||||
name: artifact
|
name: artifact
|
||||||
path: bin/
|
path: bin/
|
||||||
|
|
||||||
upload-prerelease:
|
|
||||||
permissions: write-all
|
|
||||||
needs: [build]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifact
|
|
||||||
path: bin/
|
|
||||||
|
|
||||||
- name: Create or Update Draft Release
|
- name: Create or Update Draft Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
env:
|
env:
|
||||||
@@ -131,6 +86,3 @@ jobs:
|
|||||||
name: "draft"
|
name: "draft"
|
||||||
tag_name: "draft"
|
tag_name: "draft"
|
||||||
prerelease: true
|
prerelease: true
|
||||||
overwrite: true
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
8
Makefile
8
Makefile
@@ -22,23 +22,15 @@ ios: lib_install
|
|||||||
windows-amd64:
|
windows-amd64:
|
||||||
env GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.dll ./custom
|
env GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.dll ./custom
|
||||||
|
|
||||||
windows-386:
|
|
||||||
env GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.dll ./custom
|
|
||||||
|
|
||||||
linux-amd64:
|
linux-amd64:
|
||||||
env GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.so ./custom
|
env GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.so ./custom
|
||||||
|
|
||||||
linux-386:
|
|
||||||
env GOOS=linux GOARCH=386 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.so ./custom
|
|
||||||
|
|
||||||
macos-amd64:
|
macos-amd64:
|
||||||
env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom
|
env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom
|
||||||
macos-arm64:
|
macos-arm64:
|
||||||
env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom
|
env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME)-$@.dylib ./custom
|
||||||
|
|
||||||
macos-universal: macos-amd64 macos-arm64
|
macos-universal: macos-amd64 macos-arm64
|
||||||
lipo -create $(BINDIR)/$(NAME)-macos-amd64.dylib $(BINDIR)/$(NAME)-macos-arm64.dylib -output $(BINDIR)/$(NAME)-$@.dylib
|
lipo -create $(BINDIR)/$(NAME)-macos-amd64.dylib $(BINDIR)/$(NAME)-macos-arm64.dylib -output $(BINDIR)/$(NAME)-$@.dylib
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm $(BINDIR)/*
|
rm $(BINDIR)/*
|
||||||
Reference in New Issue
Block a user