-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (120 loc) · 3.86 KB
/
build-tdweb.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
# This is a basic workflow to help you get started with Actions
name: Build TDWeb
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
version:
required: true
ref:
default: master
description: TDLib repo ref (commit/tag/branch)
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
path: repo
- uses: actions/setup-node@v2
with:
node-version: 15
- name: Install webpack
run: npm install -g webpack
- name: Checkout EMSDK
uses: actions/checkout@v2
with:
repository: emscripten-core/emsdk
path: emsdk
- name: Set-up EMSDK
run: |
cd emsdk
./emsdk install 2.0.6
./emsdk activate 2.0.6
cd ..
shell: bash
- name: Install TDLib dependencies
run: sudo apt install cmake make clang openssl zlib1g gperf php
shell: bash
- name: Checkout TDLib
uses: actions/checkout@v2
with:
repository: tdlib/td
ref: ${{ github.event.inputs.ref }}
path: td
- name: Patch build script
run: |
sed -i -- 's/set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL")/# set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL")/g' "${GITHUB_WORKSPACE}/td/CMake/TdSetUpCompiler.cmake"
shell: bash
- name: Build OpenSSL
run: |
cd emsdk
source ./emsdk_env.sh
cd ../td/example/web
./build-openssl.sh
shell: bash
- name: Build TDLib
run: |
cd emsdk
source ./emsdk_env.sh
cd ../td/example/web
./build-tdlib.sh
shell: bash
- name: Copy TDLib
run: |
cd emsdk
source ./emsdk_env.sh
cd ../td/example/web
./copy-tdlib.sh
shell: bash
- name: Build TDWeb
run: |
cd emsdk
source ./emsdk_env.sh
cd ../td/example/web
./build-tdweb.sh
- name: Install tdweb dependencies
run: |
cd repo
npm ci
- name: Replace src and dist folders
run: |
rm -rf ./repo/src
cp -r ./td/example/web/tdweb/src ./repo
rm -rf ./repo/dist
cp -r ./td/example/web/tdweb/dist ./repo
- name: Commit changes
uses: zwaldowski/git-commit-action@v1
with:
# Directory to create commit in
working_directory: ./repo
# Commit message
commit_message: Update to ${{ github.event.inputs.version }}
- name: Update npm version
run: |
cd repo
npm version ${{ github.event.inputs.version }}
git tag -d v${{ github.event.inputs.version }}
git reset --soft HEAD~2
- name: Commit changes again
uses: zwaldowski/git-commit-action@v1
with:
# Directory to create commit in
working_directory: ./repo
# Commit message
commit_message: Update to ${{ github.event.inputs.version }}
- name: Tag & push
run: |
cd repo
git tag v${{ github.event.inputs.version }}
git push
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./repo/package.json