-
Notifications
You must be signed in to change notification settings - Fork 4
148 lines (127 loc) · 5.5 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
145
146
147
148
name: Release
on:
push:
branches: [develop]
tags:
- "v*.*.*"
workflow_dispatch: ~
env:
APP_VER: 0.0.0
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Cache SDKs
id: sdks-cache
uses: actions/cache@v3
env:
cache-name: cache-sdks
with:
path: |
~/.cache/SDKs
key: ${{ runner.os }}-1.4-darwin-14.3.1
restore-keys: |
${{ runner.os }}-sdks-
- name: Cache go dependencies
id: go-deps
uses: actions/cache@v3
env:
cache-name: cache-go-deps
with:
path: ~/go
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache go build artifacts
uses: actions/cache@v3
env:
cache-name: cache-go-artifacts
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-artifacts-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-artifacts-
- name: Cache fyne-cross
uses: actions/cache@v3
env:
cache-name: cache-fyne-cross
with:
path: ~/.cache/fyne-cross
key: ${{ runner.os }}-fyne-cross-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-fyne-cross-
- name: Get Darwin SDKs
if: steps.sdks-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/SDKs
cd ~/.cache/SDKs
echo "Downloading SDKs"
wget -q -O SDKs-1.4-darwin-14.3.1.tar.gz --no-check-certificate ${{secrets.REMOTE_HOST}}/files/SDKs-1.4-darwin-14.3.1.tar.gz?token=${{secrets.SRV_TOKEN}}
echo "Extracting SDKs"
tar -xzf SDKs-1.4-darwin-14.3.1.tar.gz
rm SDKs-1.4-darwin-14.3.1.tar.gz
echo "Listing SDKs"
ls -la
- name: Install fyne-cross
if: steps.go-deps.outputs.cache-hit != 'true'
run: |
go install github.com/fyne-io/[email protected]
- name: Install upx
run: |
sudo apt update
sudo apt install upx-ucl
- name: Build
run: |
tag=$(echo ${GITHUB_REF/refs\/tags\/v/})
if [ ${#tag} -lt 7 ]; then export APP_VER=${tag}; fi
echo "building v${APP_VER}"
fyne-cross darwin -arch=amd64,arm64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}" --macosx-sdk-path ~/.cache/SDKs/MacOSX12.sdk
fyne-cross linux -arch=amd64,arm64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}" -release
fyne-cross windows -arch=amd64 -name=Prosper -app-id=com.ventsislav-georgiev.prosper -app-version="${APP_VER}"
- name: List binaries
run: |
find fyne-cross
- name: Decrease distribution size
run: |
cp fyne-cross/dist/darwin-amd64/Prosper.app/Contents/MacOS/Prosper fyne-cross/bin/darwin-amd64/bin-darwin-amd64
cp fyne-cross/dist/darwin-arm64/Prosper.app/Contents/MacOS/Prosper fyne-cross/bin/darwin-arm64/bin-darwin-arm64
upx fyne-cross/bin/darwin-*/*
upx fyne-cross/bin/linux-*/*
upx fyne-cross/bin/windows-*/*
- name: Prepare release artifacts
run: |
gzip fyne-cross/bin/darwin-amd64/bin-darwin-amd64
gzip fyne-cross/bin/darwin-arm64/bin-darwin-arm64
cd fyne-cross/dist/darwin-amd64 && zip -r Prosper-darwin-amd64.zip Prosper.app && cd ../../..
cd fyne-cross/dist/darwin-arm64 && zip -r Prosper-darwin-arm64.zip Prosper.app && cd ../../..
gzip fyne-cross/bin/linux-amd64/Prosper && mv fyne-cross/bin/linux-amd64/Prosper.gz fyne-cross/bin/linux-amd64/bin-linux-amd64.gz
gzip fyne-cross/bin/linux-arm64/Prosper && mv fyne-cross/bin/linux-arm64/Prosper.gz fyne-cross/bin/linux-arm64/bin-linux-arm64.gz
mv fyne-cross/dist/linux-amd64/Prosper.tar.xz fyne-cross/dist/linux-amd64/Prosper-linux-amd64.tar.xz
mv fyne-cross/dist/linux-arm64/Prosper.tar.xz fyne-cross/dist/linux-arm64/Prosper-linux-arm64.tar.xz
mv fyne-cross/bin/windows-amd64/Prosper fyne-cross/bin/windows-amd64/Prosper.exe && gzip fyne-cross/bin/windows-amd64/Prosper.exe && mv fyne-cross/bin/windows-amd64/Prosper.exe.gz fyne-cross/bin/windows-amd64/bin-windows-amd64.gz
mv fyne-cross/dist/windows-amd64/Prosper.zip fyne-cross/dist/windows-amd64/Prosper-windows-amd64.zip
- name: List all
run: |
find fyne-cross
- name: Create release
uses: softprops/action-gh-release@v1
- name: Upload release artifacts
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
fyne-cross/bin/darwin-amd64/bin-darwin-amd64.gz
fyne-cross/bin/darwin-arm64/bin-darwin-arm64.gz
fyne-cross/dist/darwin-amd64/Prosper-darwin-amd64.zip
fyne-cross/dist/darwin-arm64/Prosper-darwin-arm64.zip
fyne-cross/bin/linux-amd64/bin-linux-amd64.gz
fyne-cross/bin/linux-arm64/bin-linux-arm64.gz
fyne-cross/dist/linux-amd64/Prosper-linux-amd64.tar.xz
fyne-cross/dist/linux-arm64/Prosper-linux-arm64.tar.xz
fyne-cross/bin/windows-amd64/bin-windows-amd64.gz
fyne-cross/dist/windows-amd64/Prosper-windows-amd64.zip