-
Notifications
You must be signed in to change notification settings - Fork 16
203 lines (198 loc) · 7.02 KB
/
syrius_builder.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Build and release syrius
on:
push:
branches-ignore:
- master
tags:
- '*'
workflow_dispatch:
env:
FLUTTER_VERSION: "3.24.3"
jobs:
build-macos:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout zenon-node-database repository
uses: actions/checkout@v4
with:
repository: zenon-network/zenon-node-database
path: ./node-db
ref: main
- name: Copy community nodes
run: cp -r ./node-db/rpc-nodes-mainnet.json ./assets/community-nodes.json
- name: Setup environment
run: |
brew install unzip create-dmg
brew cleanup
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{env.FLUTTER_VERSION}}
channel: "stable"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-macos-desktop
flutter build macos --release
- name: Package into DMG
run: |
create-dmg --volname syrius \
--volicon macos/dmg/volume.icns \
--icon "s\ y\ r\ i\ u\ s.app" 210 175 \
--icon-size 90 \
--app-drop-link 390 175 \
--text-size 14 \
--background macos/dmg/background.png \
--window-pos 300 200 \
--window-size 600 325 \
--hide-extension "s\ y\ r\ i\ u\ s.app" \
--format ULFO \
--hdiutil-verbose syrius-alphanet-macos-universal.dmg build/macos/Build/Products/Release/s\ y\ r\ i\ u\ s.app \
syrius-alphanet-macos-universal.dmg build/macos/Build/Products/Release/s\ y\ r\ i\ u\ s.app
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-artifacts
path: syrius-alphanet-macos-universal.dmg
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout zenon-node-database repository
uses: actions/checkout@v4
with:
repository: zenon-network/zenon-node-database
path: ./node-db
ref: main
- name: Copy community nodes
shell: pwsh
run: Copy-Item .\node-db\rpc-nodes-mainnet.json .\assets\community-nodes.json -Force
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{env.FLUTTER_VERSION}}
channel: "stable"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-windows-desktop
flutter build windows --release
- name: Package into zip
run: |
Compress-Archive -Path build\windows\x64\runner\Release\* -DestinationPath .\syrius-alphanet-windows-amd64.zip
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: syrius-alphanet-windows-amd64.zip
build-linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout zenon-node-database repository
uses: actions/checkout@v4
with:
repository: zenon-network/zenon-node-database
path: ./node-db
ref: main
- name: Copy community nodes
run: cp -r ./node-db/rpc-nodes-mainnet.json assets/community-nodes.json
- name: Prepare environment
run: |
sudo apt update
sudo apt install -y curl clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev unzip xz-utils zip libnotify-dev libayatana-appindicator3-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{env.FLUTTER_VERSION}}
channel: "stable"
- name: Set permissions
run: |
sudo chmod -R 777 linux/
- name: Check flutter version
run: |
which flutter
flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-linux-desktop
flutter build linux --release -v
- name: Package zip
run: |
cd build/linux/x64/release/bundle
zip -r ../../../../../syrius-alphanet-linux-amd64.zip *
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: syrius-alphanet-linux-amd64.zip
make-release:
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set variables
run: |
echo "SYRIUS_VERSION=${{ github.ref }}" >> $GITHUB_ENV
echo "Syrius Version: $SYRIUS_VERSION"
GOZENON=$(curl -s https://raw.githubusercontent.com/zenon-network/go-zenon/master/metadata/version.go | grep Version | awk -F '"' '{print $2}')
echo "Go-Zenon Version: $GOZENON"
BODY=$(cat <<EOF
Syrius $SYRIUS_VERSION features the pre-release version of the [go-zenon](https://github.com/zenon-network/go-zenon) $GOZENON full node.
Syrius for Windows requires Microsoft Visual C++ to be installed.
[Download Microsoft Visual C++](https://aka.ms/vs/16/release/vc_redist.x64.exe)
Github Action Context information
Git reference: ${{ github.ref }}
Repository URL: ${{ github.repositoryUrl }}
Run ID: ${{ github.run_id }}
Commit hash: ${{ github.sha }}
Workflow hash: ${{ github.workflow_sha }}
EOF
)
echo "$BODY"
echo "BODY<<EOFMARKER" >> ${GITHUB_ENV}
echo "${BODY}" >> ${GITHUB_ENV}
echo "EOFMARKER" >> ${GITHUB_ENV}
- name: Prepare releases directory
run: mkdir releases
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: macos-artifacts
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows-artifacts
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifacts
- name: Prepare releases
run: |
cp syrius-alphanet-windows-amd64.zip releases/
cp syrius-alphanet-macos-universal.dmg releases/
cp syrius-alphanet-linux-amd64.zip releases/
- name: Generate checksums
run: |
cd releases/
echo $(sha256sum *)
echo $(sha256sum *) >> SHA256CHECKSUMS.txt
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: ${{ env.SYRIUS_VERSION }}
prerelease: ${{ contains(env.SYRIUS_VERSION, '-') }}
tag: ${{ env.SYRIUS_VERSION }}
file_glob: true
file: releases/*
overwrite: true
body: ${{ env.BODY }}