forked from monero-project/monero
-
Notifications
You must be signed in to change notification settings - Fork 0
204 lines (187 loc) · 5.29 KB
/
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
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
204
name: ci/gh-actions/cli
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
REMOVE_BUNDLED_BOOST : rm -rf /usr/local/share/boost
APT_INSTALL_LINUX: 'sudo apt install -y curl unzip automake build-essential file pkg-config git python3 python-is-python3 libtool libtinfo5 cmake clang ccache'
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
CCACHE_SETTINGS: |
ccache --max-size=350M
ccache --set-config=compression=true
jobs:
# build-android:
# runs-on: ubuntu-latest
# env:
# CCACHE_TEMPDIR: /tmp/.ccache-temp
# steps:
#
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - uses: actions/cache@v3
# with:
# path: ~/.ccache
# key: ccache-ubuntu-build-${{ github.sha }}
# restore-keys: ccache-ubuntu-build-
#
# - name: Remove bundled Boost.
# run: ${{env.REMOVE_BUNDLED_BOOST}}
#
# - name: Set apt.conf
# run: ${{env.APT_SET_CONF}}
#
# - name: Update apt.
# run: sudo apt update -y
#
# - name: Install dependencies.
# run: ${{env.APT_INSTALL_LINUX}}
#
# - name: Build.
# run: |
# ${{env.CCACHE_SETTINGS}}
# cd build_scripts/android
# ./build_all.sh
#
# - name: Create zip-arcive.
# run: |
# cd build_scripts/android
# zip -r dist-android.zip dist
#
# - uses: actions/upload-artifact@v3
# with:
# name: dist-android.zip
# path: build_scripts/android/dist-android.zip
# retention-days: 1
#
# build-macos:
# runs-on: macos-13
# env:
# CCACHE_TEMPDIR: /tmp/.ccache-temp
# steps:
#
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - uses: actions/cache@v3
# with:
# path: ~/.ccache
# key: ccache-${{ runner.os }}-build-macos-${{ github.sha }}
# restore-keys: ccache-${{ runner.os }}-build-macos-
#
# - name: install dependencies
# run: |
# HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
#
# - name: Build.
# run: |
# cd build_scripts/macos
# ./build_all.sh
#
# - name: Create zip-arcive.
# run: |
# cd build_scripts/macos
# zip -r dist-macos.zip dist
#
# - uses: actions/upload-artifact@v3
# with:
# name: dist-macos.zip
# path: build_scripts/macos/dist-macos.zip
# retention-days: 1
build-ios:
runs-on: macos-13
env:
CCACHE_TEMPDIR: /tmp/.ccache-temp
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{ runner.os }}-build-ios-${{ github.sha }}
restore-keys: ccache-${{ runner.os }}-build-ios-
- name: install dependencies
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- name: Build.
run: |
${{env.CCACHE_SETTINGS}}
cd build_scripts/ios
./build_all.sh
- name: Create zip-arcive.
run: |
cd build_scripts/ios
zip -r dist-ios.zip dist
- uses: actions/upload-artifact@v3
with:
name: dist-ios.zip
path: build_scripts/ios/dist-ios.zip
retention-days: 1
#Release
create-release:
runs-on: ubuntu-latest
#needs: [build-android, build-macos, build-ios]
needs: [build-ios]
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 }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
# # Android
# - name: Download Android artifact.
# uses: actions/download-artifact@v3
# with:
# name: dist-android.zip
#
# - name: Upload Android artifact.
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist-android.zip
# asset_name: dist-android.zip
# asset_content_type: application/zip
# iOS
- name: Download iOS artifact.
uses: actions/download-artifact@v3
with:
name: dist-ios.zip
- name: Upload iOS artifact.
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist-ios.zip
asset_name: dist-ios.zip
asset_content_type: application/zip
# # macOS
# - name: Download macOS artifact.
# uses: actions/download-artifact@v3
# with:
# name: dist-macos.zip
#
# - name: Upload macOS artifact.
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist-macos.zip
# asset_name: dist-macos.zip
# asset_content_type: application/zip