-
Notifications
You must be signed in to change notification settings - Fork 11
153 lines (151 loc) · 5.86 KB
/
main.yml
File metadata and controls
153 lines (151 loc) · 5.86 KB
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
152
153
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
package:
strategy:
matrix:
go-version: [1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Get wails
run: go get -u github.com/wailsapp/wails/cmd/wails@v1.0.2
- name: Build package osx
run: |
export PATH=${PATH}:`go env GOPATH`/bin
echo "building on ${{ matrix.platform }}"
mkdir -p ~/.wails
cp wails.json ~/.wails/
export LOG_LEVEL=debug
export GODEBUG=1
wails build -p
ls
echo "turning the .app into a .dmg"
npm install -g appdmg
appdmg dmg-spec.json Portfall.dmg
if: matrix.platform == 'macos-latest'
- name: Build package linux
run: |
sudo apt update && sudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev
export PATH=${PATH}:`go env GOPATH`/bin
echo "building on ${{ matrix.platform }}"
mkdir -p ~/.wails
cp wails.json ~/.wails/
export LOG_LEVEL=debug
export GODEBUG=1
wails build
# turn into app image
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
ls ./
./linuxdeploy*.AppImage --appdir AppDir --executable Portfall --desktop-file=Portfall.AppImage.desktop --icon-file=appicon.png --output appimage
if: matrix.platform == 'ubuntu-latest'
- name: Build package windows
run: |
$GP = (go env GOPATH)
$env:path = "$env:path;$GP\bin"
echo "building on ${{ matrix.platform }}"
New-Item -ItemType directory -Path "$HOME\.wails" -Force
Copy-Item -Path "$PWD\wails.json" -Destination "$HOME\.wails\wails.json"
choco install mingw
wails build -p
if: matrix.platform == 'windows-latest'
- name: upload artifact osx
uses: actions/upload-artifact@v1
with:
name: portfall-osx
path: Portfall.dmg
if: matrix.platform == 'macos-latest'
- name: upload artifact linux
uses: actions/upload-artifact@v2-preview
with:
name: portfall-linux
path: Portfall*.AppImage
if: matrix.platform == 'ubuntu-latest'
- name: upload artifact windows
uses: actions/upload-artifact@v1
with:
name: portfall-windows
path: Portfall.exe
if: matrix.platform == 'windows-latest'
release:
runs-on: ubuntu-latest
needs: package
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: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Download osx package
uses: actions/download-artifact@v1
with:
name: portfall-osx
- name: Upload OSX package to release
id: upload-osx-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./portfall-osx/Portfall.dmg
asset_name: Portfall.dmg
asset_content_type: application/octet-stream
- name: Download linux package
uses: actions/download-artifact@v1
with:
name: portfall-linux
- id: getfilename
run: echo "::set-output name=file::$(ls portfall-linux/Portfall*.AppImage)"
- 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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ steps.getfilename.outputs.file }}
asset_name: Portfall-x86_64.AppImage
asset_content_type: application/octet-stream
- name: Download windows package
uses: actions/download-artifact@v1
with:
name: portfall-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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./portfall-windows/Portfall.exe
asset_name: Portfall.exe
asset_content_type: application/octet-stream
# snapify:
# runs-on: ubuntu-latest
# steps:
# - name: Check out Git repository
# uses: actions/checkout@v2
# - name: Install Snapcraft
# uses: samuelmeuli/action-snapcraft@v1
# with:
# snapcraft_token: ${{ secrets.snapcraft_token }}
# use_lxd: true
# - name: Build snap
# run: snapcraft --use-lxd
# - name: Release snap
# run: snapcraft push --release=stable portfall_*.snap