Skip to content

Commit c4131fd

Browse files
committed
ci: make the build and release cross-platform
1 parent c226bb3 commit c4131fd

File tree

1 file changed

+17
-53
lines changed

1 file changed

+17
-53
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ name: Wails build
1515
# echo "VITE_APP_VERSION=$RELEASE_VERSION" >> ./frontend/.env
1616

1717
on:
18-
push:
19-
tags:
20-
- "v*"
18+
pull_request:
19+
release:
20+
types: [created]
21+
2122
jobs:
2223
package:
2324
strategy:
2425
matrix:
2526
go-version: [ 1.19 ]
26-
os: [ macos-latest, windows-latest]
27+
os: [ubuntu-latest, windows-latest, macos-latest]
2728
runs-on: ${{ matrix.os }}
2829
steps:
2930
- name: Install Go
@@ -41,57 +42,20 @@ jobs:
4142
- name: Get Wails
4243
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
4344

44-
- name: Build Wails app
45-
run: |
46-
wails build
47-
48-
- name: zip macos artifact
49-
if: matrix.os == 'macos-latest'
45+
- name: Install Ubuntu Dependencies
46+
if: contains(matrix.os, 'ubuntu')
5047
run: |
51-
cd ./build/bin
52-
zip -r ./../../surreal_explorer_mac.zip ./SurrealDB\ Explorer.app
53-
54-
- name: upload artifact macOS
55-
if: matrix.os == 'macos-latest'
56-
uses: actions/upload-artifact@v2
57-
with:
58-
name: surreal_explorer_mac
59-
path: surreal_explorer_mac.zip
48+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
6049
61-
- name: zip windows artifact
62-
if: matrix.os == 'windows-latest'
50+
- name: Build Wails app
6351
run: |
64-
Compress-Archive -Path .\build\bin\surrealdb_explorer* -DestinationPath .\surreal_explorer_windows.zip
65-
66-
- name: upload artifact windows
67-
if: matrix.os == 'windows-latest'
68-
uses: actions/upload-artifact@v2
69-
with:
70-
name: surreal_explorer_windows
71-
path: surreal_explorer_windows.zip
72-
73-
release:
74-
runs-on: ubuntu-latest
75-
needs: package
76-
steps:
77-
- name: Download macOS package
78-
uses: actions/download-artifact@v3
79-
with:
80-
name: surreal_explorer_mac
81-
82-
- name: Download windows package
83-
uses: actions/download-artifact@v3
84-
with:
85-
name: surreal_explorer_windows
86-
87-
- name: Display structure of downloaded files
88-
run: ls -R
52+
wails build
8953
90-
- name: Create Release
91-
uses: "marvinpinto/action-automatic-releases@latest"
54+
# Upload artifacts to GitHub Release when it is created
55+
- if: github.event_name == 'release'
56+
uses: wangyoucao577/go-release-action@v1
9257
with:
93-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
94-
prerelease: true
95-
files: |
96-
./surreal_explorer_mac.zip
97-
./surreal_explorer_windows.zip
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
goversion: ${{ matrix.go-version }}
60+
binary_name: "surreal_explorer"
61+
extra_files: README.md

0 commit comments

Comments
 (0)