-
Notifications
You must be signed in to change notification settings - Fork 7
232 lines (221 loc) Β· 8.27 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
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
name: API CLients
on:
push:
branches:
- master
jobs:
build-go:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.9
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPRIVATE: github.com/phrase/phrase-go
run: |
npm install
npm run generate.go
git clone https://[email protected]/phrase/phrase-go.git clones/go &> /dev/null
rsync -avI --delete --exclude='.git/' clients/go/ clones/go
cd clones/go
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a v$PACKAGE_VERSION -m v$PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi
build-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.9
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOPRIVATE: github.com/phrase/phrase-go
run: |
npm install
npm run generate.cli
git clone https://[email protected]/phrase/phrase-cli.git clones/cli &> /dev/null
rsync -avI --delete --exclude='.git/' clients/cli/ clones/cli
cd clones/cli
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi
build-ruby:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run generate.ruby
git clone https://[email protected]/phrase/phrase-ruby.git clones/ruby &> /dev/null
rsync -avI --delete --exclude='.git/' clients/ruby/ clones/ruby
cd clones/ruby
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi
build-typescript:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run generate.typescript
git clone https://[email protected]/phrase/phrase-js.git clones/typescript &> /dev/null
rsync -avI --delete --exclude='.git/' clients/typescript/ clones/typescript
cd clones/typescript
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi
build-python:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run generate.python
git clone https://[email protected]/phrase/phrase-python.git clones/python &> /dev/null
rsync -avI --delete --exclude='.git/' clients/python/ clones/python
cd clones/python
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi
build-java:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run generate.java
git clone https://[email protected]/phrase/phrase-java.git clones/java &> /dev/null
rsync -avI --delete --exclude='.git/' clients/java/ clones/java
cd clones/java
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi
build-php:
runs-on: ubuntu-latest
steps:
- name: Checkout ποΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy π
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm run generate.php
git clone https://[email protected]/phrase/phrase-php.git clones/php &> /dev/null
rsync -avI --delete --exclude='.git/' clients/php/ clones/php
cd clones/php
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Phrase"
git add .
git commit --message "Deploying from phrase/openapi@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin master
else
echo " No changes, skipping."
fi