-
Notifications
You must be signed in to change notification settings - Fork 325
199 lines (172 loc) · 5.88 KB
/
ci.yml
File metadata and controls
199 lines (172 loc) · 5.88 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
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
#
# OpenSSL for iOS and Android - CI Workflow
# Created by Leso_KN - 2020
#
name: CI
on: [push]
##
jobs:
generate-release:
runs-on: macos-latest
steps:
- name: Generate Data
run: |
sha="${{ github.sha }}" && echo "short_sha=${sha:0:8}" >> $GITHUB_ENV
dt="${{ github.event.commits[0].timestamp }}" && echo "release_date=${dt:0:10}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ci-release-${{ env.short_sha }}
release_name: Release ${{ env.release_date }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
##
openssl-nghttp2:
strategy:
matrix:
target: [ios, android]
component: [openssl, nghttp2]
include:
# iOS Configuration
- target: ios
arch: arm64
sdk: iphoneos
api: "8.0"
platform: iPhoneOS
# Android Configuration
- target: android
arch: arm64
abi: arm64-v8a
api: 23
# OpenSSL version
- component: openssl
version: "1.1.1d"
# nghttp2 version
- component: nghttp2
version: "1.40.0"
fail-fast: false
runs-on: macos-latest
needs: [generate-release]
steps:
- name: Checkout Sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Environment Variables
run: |
set -x
export ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" >> $GITHUB_ENV
echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV
echo "abi=${{ matrix.abi }}" >> $GITHUB_ENV
echo "sdk=${{ matrix.sdk }}" >> $GITHUB_ENV
echo "api=${{ matrix.api }}" >> $GITHUB_ENV
echo "platform=${{ matrix.platform }}" >> $GITHUB_ENV
echo "version=${{ matrix.version }}" >> $GITHUB_ENV
echo "product_dir=${{ matrix.component }}_${{ matrix.version }}-${{ matrix.target }}-${{ matrix.arch }}" >> $GITHUB_ENV
source $GITHUB_ENV
set
- name: Build ${{ matrix.component }} for ${{ matrix.target }}
run: |
cd tools
./build-${{ matrix.target }}-${{ matrix.component }}.sh
cd ..
mkdir -p "$product_dir/"{lib,include}
mv "output/${{ matrix.target }}/${{ matrix.component }}-${{ matrix.abi || matrix.arch }}/"{lib,include} "$product_dir/" || true
if: always()
- name: Upload Binaries
uses: actions/upload-artifact@v1
with:
name: ${{ env.product_dir }}
path: ./${{ env.product_dir }}
if: always()
- name: Zip Binaries
run: |
cd "$product_dir"
zip -r ../$product_dir.zip *
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: ${{ env.product_dir }}.zip
asset_name: ${{ env.product_dir }}.zip
asset_content_type: application/zip
##
curl:
strategy:
matrix:
target: [ios, android]
component: [curl]
include:
# iOS Configuration
- target: ios
arch: arm64
sdk: iphoneos
api: "8.0"
platform: iPhoneOS
# Android Configuration
- target: android
arch: arm64
abi: arm64-v8a
api: 23
# cURL version
- component: curl
version: "7.68.0"
fail-fast: false
runs-on: macos-latest
needs: [generate-release, openssl-nghttp2]
steps:
- name: Checkout Sources
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Environment Variables
run: |
set -x
export ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" >> $GITHUB_ENV
echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV
echo "abi=${{ matrix.abi }}" >> $GITHUB_ENV
echo "sdk=${{ matrix.sdk }}" >> $GITHUB_ENV
echo "api=${{ matrix.api }}" >> $GITHUB_ENV
echo "platform=${{ matrix.platform }}" >> $GITHUB_ENV
echo "version=${{ matrix.version }}" >> $GITHUB_ENV
echo "product_dir=${{ matrix.component }}_${{ matrix.version }}-${{ matrix.target }}-${{ matrix.arch }}" >> $GITHUB_ENV
source $GITHUB_ENV
set
- name: Build ${{ matrix.component }} for ${{ matrix.target }}
run: |
cd tools
./build-${{ matrix.target }}-${{ matrix.component }}.sh
cd ..
mkdir -p "$product_dir/"{lib,include}
mv "output/${{ matrix.target }}/${{ matrix.component }}-${{ matrix.abi || matrix.arch }}/"{lib,include} "$product_dir/" || true
if: always()
- name: Upload Binaries
uses: actions/upload-artifact@v1
with:
name: ${{ env.product_dir }}
path: ./${{ env.product_dir }}
if: always()
- name: Zip Binaries
run: |
cd "$product_dir"
zip -r ../$product_dir.zip *
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: ${{ env.product_dir }}.zip
asset_name: ${{ env.product_dir }}.zip
asset_content_type: application/zip