-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (116 loc) · 3.49 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build and Release
on:
push:
tags:
- "*"
env:
MACOS_ZIP: Dolphin_MacOS_${{ github.ref_name }}.zip
WINDOWS_ZIP: Dolphin_Windows_Setup_${{ github.ref_name }}.zip
LINUX_ZIP: Dolphin_Linux_${{ github.ref_name }}.zip
jobs:
build-macos:
environment:
name: release
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install Wails CLI
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build for macOS
run: |
wails build -platform darwin/universal -ldflags "-X main.Version=${{ github.ref_name }}"
- name: Zip macOS binary
run: |
zip -r ${{ env.MACOS_ZIP }} ./build/bin/Dolphin.app
- name: Upload macOS zip
uses: actions/upload-artifact@v4
with:
name: Dolphin_MacOS
path: ${{ env.MACOS_ZIP }}
build-windows-and-linux:
environment:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev nsis
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install Wails CLI
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build for Windows/amd64
run: |
wails build -platform windows/amd64 -ldflags "-X main.Version=$GITHUB_REF_NAME" --nsis
rm ./build/bin/Dolphin.exe
mv ./build/bin/Dolphin-amd64-installer.exe ./Dolphin_Windows_Amd64-Setup.exe
- name: Zip Windows amd64 installer
run: |
zip -r ${{ env.WINDOWS_ZIP }} ./Dolphin_Windows_Amd64-Setup.exe
- name: Build for Linux/amd64
run: |
wails build -platform linux/amd64 -ldflags "-X main.Version=$GITHUB_REF_NAME"
mkdir ./Dolphin_Linux_Amd64
mv ./build/bin ./Dolphin_Linux_Amd64
- name: Zip Linux amd64 binary
run: |
zip -r ${{ env.LINUX_ZIP }} ./Dolphin_Linux_Amd64
- name: Upload Windows/amd64 zip
uses: actions/upload-artifact@v4
with:
name: Dolphin_Windows_Setup
path: ${{ env.WINDOWS_ZIP }}
- name: Upload Linux/amd64 zip
uses: actions/upload-artifact@v4
with:
name: Dolphin_Linux
path: ${{ env.LINUX_ZIP }}
create-release:
environment:
name: release
runs-on: ubuntu-latest
needs:
- build-macos
- build-windows-and-linux
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download macOS zip
uses: actions/download-artifact@v4
with:
name: Dolphin_MacOS
path: ./artifacts
- name: Download Windows amd64 zip
uses: actions/download-artifact@v4
with:
name: Dolphin_Windows_Setup
path: ./artifacts
- name: Download Linux amd64 zip
uses: actions/download-artifact@v4
with:
name: Dolphin_Linux
path: ./artifacts
- name: List files in artifacts directory
run: ls -R ./artifacts
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
./artifacts/${{ env.MACOS_ZIP }}
./artifacts/${{ env.WINDOWS_ZIP }}
./artifacts/${{ env.LINUX_ZIP }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}