Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita98b024

Browse files
authored
Merge pull request#1309 from 0xJacky/ci/build-macos-native
ci: build macos native
2 parentsccad4d1 +e697d2b commita98b024

File tree

2 files changed

+102
-35
lines changed

2 files changed

+102
-35
lines changed

‎.github/workflows/build.yml‎

Lines changed: 102 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ on:
4141

4242
jobs:
4343
build_app:
44-
runs-on:macos-14
44+
runs-on:macos-latest
4545
steps:
4646
-name:Checkout
4747
uses:actions/checkout@v5
@@ -97,12 +97,12 @@ jobs:
9797
needs:build_app
9898
strategy:
9999
matrix:
100-
goos:[ linux,darwin,windows ]
100+
goos:[ linux, windows ]
101101
goarch:[ amd64, 386, arm64 ]
102-
exclude:
103-
# Exclude i386 ondarwin.
104-
-goarch:386
105-
goos:darwin
102+
#exclude:
103+
# Exclude i386 onwindows (if needed)
104+
#- goarch: 386
105+
#goos:windows
106106
include:
107107
# BEGIN Linux ARM 5 6 7
108108
-goos:linux
@@ -141,7 +141,7 @@ jobs:
141141
-name:Set up Go
142142
uses:actions/setup-go@v5
143143
with:
144-
go-version:^1.24.6
144+
go-version:^1.25.0
145145
cache:false
146146

147147
-name:Setup environment
@@ -301,10 +301,102 @@ jobs:
301301
302302
echo "Upload completed successfully"
303303
304+
build_macos_native:
305+
runs-on:macos-latest
306+
needs:build_app
307+
strategy:
308+
matrix:
309+
goarch:[amd64, arm64]
310+
env:
311+
CGO_ENABLED:1
312+
GOOS:darwin
313+
GOARCH:${{ matrix.goarch }}
314+
steps:
315+
-name:Checkout
316+
uses:actions/checkout@v5
317+
318+
-name:Set up Go
319+
uses:actions/setup-go@v5
320+
with:
321+
go-version:^1.25.0
322+
cache:false
323+
324+
-name:Setup environment
325+
id:info
326+
run:|
327+
export _NAME=$(jq ".darwin[\"$GOARCH\"].name" -r < .github/build/build_info.json)
328+
export _ARTIFACT=nginx-ui-darwin-$GOARCH
329+
export _BINARY=nginx-ui
330+
echo "GOOS: darwin, GOARCH: $GOARCH, RELEASE_NAME: $_NAME, ARTIFACT_NAME: $_ARTIFACT, BINARY_NAME: $_BINARY"
331+
echo "CACHE_NAME=$_NAME" >> $GITHUB_ENV
332+
echo "DIST=nginx-ui-$_NAME" >> $GITHUB_ENV
333+
echo "ARTIFACT=$_ARTIFACT" >> $GITHUB_ENV
334+
echo "BINARY_NAME=$_BINARY" >> $GITHUB_ENV
335+
336+
-name:Setup Go build cache
337+
uses:actions/cache@v4
338+
with:
339+
path:|
340+
~/go/pkg/mod
341+
~/.cache/go-build
342+
key:go-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NAME }}-${{ hashFiles('go.mod') }}
343+
restore-keys:|
344+
go-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NAME }}-
345+
346+
-name:Download app artifacts
347+
uses:actions/download-artifact@v5
348+
with:
349+
name:app-dist
350+
path:app/dist
351+
352+
-name:Generate files
353+
run:go generate cmd/version/generate.go
354+
355+
-name:Build with native CGO
356+
run:|
357+
mkdir -p dist
358+
go build -trimpath -tags=jsoniter -ldflags "-w -X 'github.com/0xJacky/Nginx-UI/settings.buildTime=$(date +%s)'" -o dist/$BINARY_NAME -v main.go
359+
360+
-name:Archive backend artifacts
361+
uses:actions/upload-artifact@v4
362+
with:
363+
name:${{ env.ARTIFACT }}
364+
path:dist/${{ env.BINARY_NAME }}
365+
366+
-name:Prepare publish
367+
run:|
368+
cp README*.md ./dist
369+
cd dist && tar -zcvf ../${{ env.DIST }}.tar.gz .
370+
cd ..
371+
openssl dgst -sha512 ${{ env.DIST }}.tar.gz | sed 's/([^)]*)//g' | awk '{print $NF}' >> ${{ env.DIST }}.tar.gz.digest
372+
373+
-name:Publish
374+
uses:softprops/action-gh-release@v2
375+
if:github.event_name == 'release'
376+
with:
377+
files:|
378+
${{ env.DIST }}.tar.gz
379+
${{ env.DIST }}.tar.gz.digest
380+
381+
-name:Upload to R2 using S3 API
382+
if:github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
383+
env:
384+
AWS_ACCESS_KEY_ID:${{ secrets.R2_ACCESS_KEY_ID }}
385+
AWS_SECRET_ACCESS_KEY:${{ secrets.R2_SECRET_ACCESS_KEY }}
386+
AWS_REGION:us-east-1
387+
run:|
388+
echo "Uploading ${{ env.DIST }}.tar.gz to R2..."
389+
aws s3 cp ./${{ env.DIST }}.tar.gz s3://nginx-ui-dev-build/${{ env.DIST }}.tar.gz --endpoint-url=${{ secrets.R2_S3_API_ENDPOINT }}
390+
391+
echo "Uploading ${{ env.DIST }}.tar.gz.digest to R2..."
392+
aws s3 cp ./${{ env.DIST }}.tar.gz.digest s3://nginx-ui-dev-build/${{ env.DIST }}.tar.gz.digest --endpoint-url=${{ secrets.R2_S3_API_ENDPOINT }}
393+
394+
echo "Upload completed successfully"
395+
304396
docker-build:
305397
if:github.event_name != 'pull_request'
306398
runs-on:ubuntu-latest
307-
needs:build
399+
needs:[build, build_macos_native]
308400
env:
309401
PLATFORMS:linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/arm/v5
310402
steps:
@@ -376,7 +468,7 @@ jobs:
376468
377469
update-homebrew:
378470
runs-on:ubuntu-latest
379-
needs:build
471+
needs:[build, build_macos_native]
380472
if:github.event_name == 'release'
381473
steps:
382474
-name:Checkout
@@ -556,7 +648,7 @@ jobs:
556648
557649
publish-winget:
558650
runs-on:windows-latest
559-
needs:build
651+
needs:[build, build_macos_native]
560652
if:github.event_name == 'release'
561653
steps:
562654
-name:Checkout

‎app/vite.config.ts‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,6 @@ export default defineConfig(({ mode }) => {
9090
},
9191
build:{
9292
chunkSizeWarningLimit:1500,
93-
rollupOptions:{
94-
output:{
95-
advancedChunks:{
96-
groups:[
97-
// Code editors
98-
{name:'ace-editor',test:/ace-builds/},
99-
100-
// Vue ecosystem
101-
{name:'vue-vendor',test:/[\\/]node_modules[\\/](vue|@vue|vue-router|pinia)[\\/]/},
102-
103-
// Ant Design Vue
104-
{name:'antdv',test:/[\\/]node_modules[\\/]ant-design-vue[\\/]/},
105-
106-
// Chart libraries
107-
{name:'charts',test:/[\\/]node_modules[\\/](echarts|@antv|chart\.js)[\\/]/},
108-
109-
// Utility libraries
110-
{name:'utils',test:/[\\/]node_modules[\\/](lodash|dayjs|moment|axios)[\\/]/},
111-
112-
// UI utilities
113-
{name:'ui-utils',test:/[\\/]node_modules[\\/](@vueuse|vue-demi)[\\/]/},
114-
],
115-
},
116-
},
117-
},
11893
},
11994
}
12095
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp