Skip to content

Commit 5973578

Browse files
committed
fix: failed build macos and linux
1 parent 55271be commit 5973578

1 file changed

Lines changed: 20 additions & 45 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,22 @@ jobs:
5252
tar -czf querybox-linux-amd64.tar.gz -C staging .
5353
5454
- name: Package .deb
55+
env:
56+
GOARCH: amd64
5557
run: |
56-
APP_VERSION="${{ github.ref_name }}"
57-
APP_VERSION="${APP_VERSION#v}"
58-
APP_VERSION="$APP_VERSION" GOARCH=amd64 wails3 tool package \
59-
-name querybox -format deb \
60-
-config ./build/linux/nfpm/nfpm.yaml \
61-
-out ./bin
62-
cp bin/querybox_*.deb querybox-linux-amd64.deb
58+
TAG="${{ github.ref_name }}"
59+
APP_VERSION="${TAG#v}" wails3 tool package -name querybox -format deb \
60+
-config ./build/linux/nfpm/nfpm.yaml -out ./bin
61+
cp bin/querybox.deb querybox-linux-amd64.deb
6362
6463
- name: Package .rpm
64+
env:
65+
GOARCH: amd64
6566
run: |
66-
APP_VERSION="${{ github.ref_name }}"
67-
APP_VERSION="${APP_VERSION#v}"
68-
APP_VERSION="$APP_VERSION" GOARCH=amd64 wails3 tool package \
69-
-name querybox -format rpm \
70-
-config ./build/linux/nfpm/nfpm.yaml \
71-
-out ./bin
72-
cp bin/querybox-*.rpm querybox-linux-amd64.rpm
67+
TAG="${{ github.ref_name }}"
68+
APP_VERSION="${TAG#v}" wails3 tool package -name querybox -format rpm \
69+
-config ./build/linux/nfpm/nfpm.yaml -out ./bin
70+
cp bin/querybox.rpm querybox-linux-amd64.rpm
7371
7472
- uses: actions/upload-artifact@v4
7573
with:
@@ -99,41 +97,18 @@ jobs:
9997
- name: Build frontend
10098
run: cd frontend && npm ci && npm run build
10199

102-
- name: Build binary (arm64)
103-
run: |
104-
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \
105-
CGO_CFLAGS="-mmacosx-version-min=10.15" \
106-
CGO_LDFLAGS="-mmacosx-version-min=10.15" \
107-
MACOSX_DEPLOYMENT_TARGET=10.15 \
108-
go build -tags production -trimpath -buildvcs=false \
109-
-ldflags="-w -s -X github.com/felixdotgo/querybox/pkg/version.Version=${{ github.ref_name }}" \
110-
-o bin/querybox-arm64 .
100+
- name: Build plugins
101+
run: bash scripts/build-plugins.sh
111102

112-
- name: Build binary (amd64)
103+
- name: Build binary
113104
run: |
114-
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 \
105+
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \
115106
CGO_CFLAGS="-mmacosx-version-min=10.15" \
116107
CGO_LDFLAGS="-mmacosx-version-min=10.15" \
117108
MACOSX_DEPLOYMENT_TARGET=10.15 \
118109
go build -tags production -trimpath -buildvcs=false \
119110
-ldflags="-w -s -X github.com/felixdotgo/querybox/pkg/version.Version=${{ github.ref_name }}" \
120-
-o bin/querybox-amd64 .
121-
122-
- name: Create universal binary
123-
run: lipo -create -output bin/querybox bin/querybox-arm64 bin/querybox-amd64
124-
125-
- name: Build plugins (universal)
126-
run: |
127-
GOOS=darwin GOARCH=arm64 bash scripts/build-plugins.sh
128-
mkdir -p bin/plugins-arm64 && cp bin/plugins/* bin/plugins-arm64/
129-
GOOS=darwin GOARCH=amd64 bash scripts/build-plugins.sh
130-
mkdir -p bin/plugins-amd64 && cp bin/plugins/* bin/plugins-amd64/
131-
rm -rf bin/plugins && mkdir -p bin/plugins
132-
for f in bin/plugins-arm64/*; do
133-
name=$(basename "$f")
134-
lipo -create -output "bin/plugins/$name" \
135-
"bin/plugins-arm64/$name" "bin/plugins-amd64/$name"
136-
done
111+
-o bin/querybox .
137112
138113
- name: Create .app bundle
139114
run: |
@@ -147,12 +122,12 @@ jobs:
147122
codesign --force --deep --sign - bin/querybox.app
148123
149124
- name: Package
150-
run: cd bin && zip -r ../querybox-darwin-universal.zip querybox.app
125+
run: cd bin && zip -r ../querybox-darwin-arm64.zip querybox.app
151126

152127
- uses: actions/upload-artifact@v4
153128
with:
154129
name: darwin-artifact
155-
path: querybox-darwin-universal.zip
130+
path: querybox-darwin-arm64.zip
156131

157132
build-windows:
158133
name: Build (Windows)
@@ -238,7 +213,7 @@ jobs:
238213
querybox-linux-amd64.tar.gz
239214
querybox-linux-amd64.deb
240215
querybox-linux-amd64.rpm
241-
querybox-darwin-universal.zip
216+
querybox-darwin-arm64.zip
242217
querybox-windows-amd64-installer.exe
243218
env:
244219
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)