Skip to content

Commit 0fb8d26

Browse files
committed
fix: workflow 3
1 parent 02b1351 commit 0fb8d26

File tree

2 files changed

+45
-22
lines changed

2 files changed

+45
-22
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
uses: nttld/setup-ndk@v1
145145
with:
146146
ndk-version: r28
147-
local-cache: true
147+
# local-cache: true
148148

149149
- name: Setup MinGW
150150
if: startsWith(matrix.job.target,'windows')
@@ -197,25 +197,36 @@ jobs:
197197
tar -czvf ${{ matrix.job.name }}.tar.gz $files
198198
199199
working-directory: bin
200-
# - uses: actions/upload-artifact@v4
201-
# if: ${{ success() }}
202-
# with:
203-
# name: ${{ matrix.job.name }}
204-
# path: bin/*.tar.gz
205-
# retention-days: 1
200+
- uses: actions/upload-artifact@v4
201+
if: ${{ success() }}
202+
with:
203+
name: ${{ matrix.job.name }}
204+
path: bin/*.tar.gz
205+
retention-days: 1
206+
207+
208+
209+
210+
211+
212+
213+
214+
215+
216+
206217

207218
build-binary:
208219
name: Build binary
209220
# if: github.event_name != 'workflow_dispatch' || inputs.build == 'All' || inputs.build == 'Binary'
210-
# if: ${{ inputs.channel=='prod' }}
221+
if: ${{ inputs.channel=='prod' }}
211222
runs-on: ubuntu-latest
212223
needs:
213224
- calculate_version
214225
env:
215226
CODE_VERSION: "-X github.com/hiddify/hiddify-core/v2/hcommon/constants.Version=${{ needs.calculate_version.outputs.hiddify_version }} -X github.com/sagernet/sing-box/constant.Version=${{ needs.calculate_version.outputs.singbox_version }}"
216227

217228
strategy:
218-
fail-fast: false
229+
# fail-fast: false
219230
matrix:
220231
include:
221232
- { os: linux, arch: amd64, variant: purego, naive: true }
@@ -538,12 +549,12 @@ jobs:
538549
rm -r "${DIR_NAME}"
539550
- name: Cleanup
540551
run: rm -f dist/hiddify-core dist/libcronet.so
541-
# - name: Upload artifact
542-
# uses: actions/upload-artifact@v4
543-
# with:
544-
# name: hiddify-core-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.go386 && format('_{0}', matrix.go386) }}${{ matrix.gomips && format('_{0}', matrix.gomips) }}${{ matrix.legacy_name && format('-legacy-{0}', matrix.legacy_name) }}${{ matrix.variant && format('-{0}', matrix.variant) }}
545-
# path: "dist"
546-
# retention-days: 1
552+
- name: Upload artifact
553+
uses: actions/upload-artifact@v4
554+
with:
555+
name: hiddify-core-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.go386 && format('_{0}', matrix.go386) }}${{ matrix.gomips && format('_{0}', matrix.gomips) }}${{ matrix.legacy_name && format('-legacy-{0}', matrix.legacy_name) }}${{ matrix.variant && format('-{0}', matrix.variant) }}
556+
path: "dist"
557+
retention-days: 1
547558

548559

549560

@@ -611,7 +622,16 @@ jobs:
611622

612623

613624

614-
625+
delete-artifact:
626+
runs-on: ubuntu-latest
627+
needs: [upload-prerelease, upload-release]
628+
if: success()
629+
steps:
630+
- name: Delete artifact
631+
uses: geekyeggo/delete-artifact@v3
632+
with:
633+
name: |
634+
hiddify-*
615635
616636
617637
@@ -718,3 +738,5 @@ jobs:
718738
run: |
719739
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.LATEST }}
720740
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ inputs.tag-name }}
741+
742+

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ CRONET_GO_VERSION := $(shell cat hiddify-sing-box/.github/CRONET_GO_VERSION)
1414
TAGS=with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_grpc,with_awg,with_naive_outbound,tfogo_checklinkname0
1515
IOS_ADD_TAGS=with_dhcp,with_low_memory,with_conntrack
1616
WINDOWS_ADD_TAGS=with_purego
17-
GOBUILDLIB=CGO_ENABLED=1 go build -trimpath -ldflags="-w -s -checklinkname=0 -buildid= $${CODE_VERSION}" -buildmode=c-shared
18-
GOBUILDSRV=CGO_ENABLED=1 go build -ldflags "-s -w $${CODE_VERSION}" -trimpath -tags $(TAGS)
17+
LDFLAGS=-w -s -checklinkname=0 -buildid= $${CODE_VERSION}
18+
GOBUILDLIB=CGO_ENABLED=1 go build -trimpath -ldflags="$(LDFLAGS)" -buildmode=c-shared
19+
GOBUILDSRV=CGO_ENABLED=1 go build -ldflags="$(LDFLAGS)" -trimpath -tags $(TAGS)
1920

2021
CRONET_DIR=./cronet
2122
.PHONY: protos
@@ -43,15 +44,15 @@ headers:
4344
go build -buildmode=c-archive -o $(BINDIR)/ ./platform/desktop2
4445

4546
android: lib_install
46-
gomobile bind -v -androidapi=21 -javapkg=com.hiddify.core -libname=hiddify-core -tags=$(TAGS) -trimpath -ldflags -checklinkname=0 -target=android -gcflags "all=-N -l" -o $(BINDIR)/$(LIBNAME).aar github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
47+
gomobile bind -v -androidapi=21 -javapkg=com.hiddify.core -libname=hiddify-core -tags=$(TAGS) -trimpath -ldflags="$(LDFLAGS)" -target=android -gcflags "all=-N -l" -o $(BINDIR)/$(LIBNAME).aar github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
4748

4849
ios-full: lib_install
49-
gomobile bind -v -target ios,iossimulator,tvos,tvossimulator,macos -libname=hiddify-core -tags=$(TAGS),$(IOS_ADD_TAGS) -trimpath -ldflags="-w -s" -o $(BINDIR)/$(PRODUCT_NAME).xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
50+
gomobile bind -v -target ios,iossimulator,tvos,tvossimulator,macos -libname=hiddify-core -tags=$(TAGS),$(IOS_ADD_TAGS) -trimpath -ldflags="$(LDFLAGS)" -o $(BINDIR)/$(PRODUCT_NAME).xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
5051
mv $(BINDIR)/$(PRODUCT_NAME).xcframework $(BINDIR)/$(LIBNAME).xcframework
5152
cp HiddifyCore.podspec $(BINDIR)/$(LIBNAME).xcframework/
5253

5354
ios: lib_install
54-
gomobile bind -v -target ios -libname=hiddify-core -tags=$(TAGS),$(IOS_ADD_TAGS) -trimpath -ldflags="-w -s" -o $(BINDIR)/HiddifyCore.xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
55+
gomobile bind -v -target ios -libname=hiddify-core -tags=$(TAGS),$(IOS_ADD_TAGS) -trimpath -ldflags="$(LDFLAGS)" -o $(BINDIR)/HiddifyCore.xcframework github.com/sagernet/sing-box/experimental/libbox ./platform/mobile
5556
cp Info.plist $(BINDIR)/HiddifyCore.xcframework/
5657

5758

@@ -154,7 +155,7 @@ linux-custom: prepare install_cronet
154155
mkdir -p $(BINDIR)/
155156
#env GOARCH=mips $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME) ./cmd/
156157
$(load_cronet_env)
157-
go build -ldflags "-s -w" -trimpath -tags $(TAGS) -o $(BINDIR)/$(CLINAME) ./cmd/main
158+
go build -ldflags="$(LDFLAGS)" -trimpath -tags $(TAGS) -o $(BINDIR)/$(CLINAME) ./cmd/main
158159
chmod +x $(BINDIR)/$(CLINAME)
159160
make webui
160161

0 commit comments

Comments
 (0)