-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (150 loc) · 5.64 KB
/
wails-build.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
145
146
147
148
149
150
151
on:
push:
tags:
- "v*"
jobs:
package:
strategy:
matrix:
go-version: [1.21]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Set Version
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Get Wails dependencies
run: sudo apt update && sudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev
if: matrix.os == 'ubuntu-latest'
- name: Get Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build package macOS
run: |
export PATH=${PATH}:`go env GOPATH`/bin
echo "building on ${{ matrix.os }}"
mkdir -p ~/.wails
cp wails.json ~/.wails/
export LOG_LEVEL=debug
export GODEBUG=1
wails build
echo "converting .app into a .dmg"
npm install -g appdmg
appdmg dmg-spec.json blocks.dmg
zip blocks.zip blocks.dmg
if: matrix.os == 'macos-latest'
- name: Build package linux
run: |
export PATH=$PATH:$(go env GOPATH)/bin
echo "building on ${{ matrix.os }}"
echo ${{ env.GITHUB_REF }}
echo ${{ env.GITHUB_HEAD_REF }}
mkdir -p ~/.wails
cp wails.json ~/.wails/
export LOG_LEVEL=debug
export GODEBUG=1
wails build
ls -la /home/runner/work/blocks/blocks/build/bin/blocks
tar -czvf blocks.tar.gz /home/runner/work/blocks/blocks/build/bin/blocks
# wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
# chmod +x linuxdeploy*.AppImage
# ls ./
# ./linuxdeploy*.AppImage --appdir AppDir --executable ./build/blocks --desktop-file=blocks.AppImage.desktop --icon-file=appicon--512.png --output appimage
if: matrix.os == 'ubuntu-latest'
- name: Build package windows
run: |
$GP = (go env GOPATH)
$env:path = "$env:path;$GP\bin"
echo "building on ${{ matrix.os }}"
New-Item -ItemType directory -Path "$HOME\.wails" -Force
Copy-Item -Path "$PWD\wails.json" -Destination "$HOME\.wails\wails.json"
choco install mingw
wails build
Compress-Archive -Path D:\a\blocks\blocks\build\bin\blocks* -DestinationPath D:\a\blocks\blocks\blocks.zip
if: matrix.os == 'windows-latest'
- name: upload artifact macOS
uses: actions/upload-artifact@v1
with:
name: blocks-macOS
path: blocks.zip
if: matrix.os == 'macos-latest'
- name: upload artifact linux
uses: actions/upload-artifact@v2-preview
with:
name: blocks-linux
path: blocks.tar.gz
if: matrix.os == 'ubuntu-latest'
# - name: upload artifact linux appimage
# uses: actions/upload-artifact@v2-preview
# with:
# name: blocks-linux-appimage
# path: blocks-${{ env.VERSION }}-x86_64.AppImage
# if: matrix.os == 'ubuntu-latest'
- name: upload artifact windows
uses: actions/upload-artifact@v1
with:
name: blocks-windows
path: blocks.zip
if: matrix.os == 'windows-latest'
release:
runs-on: ubuntu-latest
needs: package
permissions: # Add this line and the following one to specify custom permissions
contents: write # This grants the job permission to create releases
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: true
- name: Download macOS package
uses: actions/download-artifact@v1
with:
name: blocks-macOS
- name: Upload macOS package to release
id: upload-macOS-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./blocks-macOS/blocks.zip
asset_name: blocks_${{ github.ref }}_macOS.zip
asset_content_type: application/octet-stream
- name: Download linux package
uses: actions/download-artifact@v1
with:
name: blocks-linux
- name: Upload Linux package to release
id: upload-linux-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./blocks-linux/blocks.tar.gz
asset_name: blocks_${{ github.ref }}_linux_x86_64.tar.gz
asset_content_type: application/octet-stream
- name: Download windows package
uses: actions/download-artifact@v1
with:
name: blocks-windows
- name: Upload Windows package to release
id: upload-windows-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./blocks-windows/blocks.zip
asset_name: blocks_${{ github.ref }}_windows_x86_64.zip
asset_content_type: application/octet-stream