-
Notifications
You must be signed in to change notification settings - Fork 0
268 lines (260 loc) · 9.4 KB
/
Copy pathrelease.yml
File metadata and controls
268 lines (260 loc) · 9.4 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: Release workflow
on:
workflow_dispatch:
inputs:
example_input:
description: 'An example input value'
required: false
default: 'default-value'
permissions:
contents: write
jobs:
manual-job:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && contains(fromJSON('["kroitor", "frosty00", "carlosmiei"]'), github.actor)
steps:
- name: Print Trigger Info
run: |
echo "This workflow was triggered manually."
echo "Input value: ${{ github.event.inputs.example_input }}"
- uses: actions/checkout@v4
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 2
- uses: actions/checkout@v4
if: github.ref != 'refs/heads/master'
with:
fetch-depth: 2
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
# cache: true
ini-values: |
zend.assertions=1
display_errors=On
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: create usr/share/dotnet folder
run: |
sudo mkdir -p /usr/share/dotnet
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-quality: 'preview'
run: |
sudo mkdir -p /usr/share/dotnet
- name: Install NPM dependencies
run: npm ci
- name: Composer install
run: composer install
- name: Install python dependencies
run: pip install -r ci-requirements.txt
- name: Install Wheel
run: pip install wheel twine
- name: export exchanges (remove later)
run: npm run export-exchanges
- name: Transpile and Build
run: npm run force-build
- name: Base tests Rest
run: npm run test-base-rest
- name: Base tests Ws
run: npm run test-base-ws
- name: Id tests
run: npm run id-tests
- name: Request tests
run: npm run request-tests
- name: Response tests
run: npm run response-tests
- name: CommonJs tests
run: npm run commonjs-test
- name: Package Test
run: npm run package-test
- name: Freshness Test
run: npm run test-freshness
- name: Set new Version
run: |
npm config set git-tag-version=false
NPM_VERSION=$(npm version patch)
echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV
COMMIT_MESSAGE=${NPM_VERSION:1}
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
# - name: Pull changes
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# git config --global pull.rebase false
# git add go/
# git commit -m "[Automated changes] GO"
# git pull -X ours origin master --no-edit
- name: vss and copy python-files
run: npm run vss && npm run copy-python-files
- name: Commit files
run: git add . -A
- name: Git status
run: git status
- name: cleanup old tags
run: npm run cleanup-old-tags --limit
- name: Create GH Release and git-tag-version and push
env:
COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }}
GH_TOKEN: ${{ github.token }}
VERSION: ${{ env.NPM_VERSION }}
run: |
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "go/${VERSION}" -m "${COMMIT_MESSAGE}"
git tag -a "${VERSION}" -m "${COMMIT_MESSAGE}"
git commit -m "[Automated changes] ${COMMIT_MESSAGE}"
git push origin --tags HEAD:master
echo "Creating github release..."
gh release create "${VERSION}" --generate-notes --verify-tag
git push
- name: Publish Go node_modules
env:
VERSION: ${{ env.NPM_VERSION }}
run: |
cd go/
GOPROXY=proxy.golang.org go list -m github.com/ccxt/ccxt/go/v4@$VERSION
cd ..
- name: C# Release Build
run: npm run buildCSRelease
- name: Deploy C#
env:
NUGGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
run: ./cs/deploy.sh;
- name: Deploy Python
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: cd python && ./deploy.sh && cd ..;
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
# jobs:
# manual-job:
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
# steps:
# - name: Print Trigger Info
# run: |
# echo "This workflow was triggered manually."
# echo "Input value: ${{ github.event.inputs.example_input }}"
# - uses: actions/checkout@v4
# with:
# ssh-key: ${{secrets.SECRET_KEY}}
# fetch-depth: 2
# - uses: actions/setup-node@v4
# with:
# node-version: '20'
# registry-url: "https://registry.npmjs.org"
# - name: Setup PHP with PECL extension
# uses: shivammathur/setup-php@v2
# with:
# php-version: '8.1'
# - uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# cache: 'pip'
# - name: create usr/share/dotnet folder
# run: |
# sudo mkdir -p /usr/share/dotnet
# - uses: actions/setup-dotnet@v4
# with:
# dotnet-version: '7.0.x'
# dotnet-quality: 'preview'
# run: |
# sudo mkdir -p /usr/share/dotnet
# - uses: actions/checkout@v4
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# go-version: "1.21.x"
# - name: Install NPM dependencies
# run: npm ci
# - name: Composer install
# run: composer install
# - name: Install python dependencies
# run: pip install -r ci-requirements.txt
# - name: Install Wheel
# run: pip install wheel twine
# - name: export exchanges (remove later)
# run: npm run export-exchanges
# # # - name: Transpile and Build
# # # run: npm run force-build
# # - name: Base tests Rest
# # run: npm run test-base-rest
# # - name: Base tests Ws
# # run: npm run test-base-ws
# # - name: Id tests
# # run: npm run id-tests
# # - name: Request tests
# # run: npm run request-tests
# # - name: Response tests
# # run: npm run response-tests
# # # - name: CommonJs tests
# # # run: npm run commonjs-test tmp disabling it
# # - name: Package Test
# # run: npm run package-test
# # - name: Freshness Test
# # run: npm run test-freshness
# # - name: Go Types Test
# # run: npm run test-types-go
# # Will start the deployment process
# - name: Set new Version
# run: |
# npm config set git-tag-version=false
# NPM_VERSION=$(npm version patch)
# echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV
# COMMIT_MESSAGE=${NPM_VERSION:1}
# echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
# - name: Pull changes
# run: |
# git config --global pull.rebase false
# git pull origin master
# - name: vss and copy python-files
# run: npm run vss && npm run copy-python-files
# - name: Commit files
# run: git add . -A
# - name: Git status
# run: git status
# - name: cleanup old tags
# run: npm run cleanup-old-tags --limit
# - name: Create GH Release and git-tag-version and push
# env:
# COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }}
# NPM_VERSION: ${{ env.NPM_VERSION }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# echo "COMMIT_MESSAGE=$COMMIT_MESSAGE"
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# git remote set-url origin https://${GITHUB_TOKEN}@github.com/${{ github.repository }}
# git tag -a "${NPM_VERSION}" -m "${COMMIT_MESSAGE}"
# git commit -m "${COMMIT_MESSAGE}"
# git remote set-url origin https://${GITHUB_TOKEN}@github.com/${{ github.repository }}
# git push --tags
# echo "Creating github release..."
# gh release create "${NPM_VERSION}" --generate-notes --verify-tag
# git push origin HEAD:master
# - name: Publish Go node_modules
# env:
# VERSION: ${{ env.NPM_VERSION }}
# run: |
# GOPROXY=proxy.golang.org go list -m github.com/ccxt/ccxt@$VERSION
# - name: C# Release Build
# run: npm run buildCSRelease
# - name: Deploy C#
# env:
# NUGGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
# run: ./cs/deploy.sh;
# - name: Deploy Python
# env:
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# run: cd python && ./deploy.sh && cd ..;
# - uses: JS-DevTools/npm-publish@v3
# with:
# token: ${{ secrets.NPM_TOKEN }}