Skip to content

Commit 339d188

Browse files
authored
Merge pull request #29 from tinybirdco/fix/manual_releases_job_for_github
fix v3 release jobs for github
2 parents c864f89 + 53bb09a commit 339d188

File tree

3 files changed

+126
-113
lines changed

3 files changed

+126
-113
lines changed

.github/workflows/cd.yml

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -163,116 +163,3 @@ jobs:
163163
--token ${{ secrets.tb_admin_token }} \
164164
env rm tmp_cd_${_NORMALIZED_ENV_NAME}_${GITHUB_RUN_ID} \
165165
--yes
166-
167-
release_promote:
168-
if: ${{ inputs.tb_deploy && github.event.workflow_dispatch }}
169-
runs-on: ubuntu-latest
170-
defaults:
171-
run:
172-
working-directory: ${{ inputs.data_project_dir }}
173-
needs: [push_changes]
174-
steps:
175-
- uses: actions/checkout@master
176-
- uses: actions/setup-python@v3
177-
with:
178-
python-version: "3.8"
179-
architecture: "x64"
180-
181-
- name: Validate input
182-
run: |
183-
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token ([email protected])' associated to a user account and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
184-
185-
- name: Install Tinybird CLI
186-
run: |
187-
if [ -f "requirements.txt" ]; then
188-
pip install -r requirements.txt
189-
else
190-
pip install tinybird-cli
191-
fi
192-
193-
- name: Tinybird version
194-
run: tb --version
195-
196-
- name: Promote Release
197-
run: |
198-
source .tinyenv
199-
tb \
200-
--host ${{ secrets.tb_host }} \
201-
--token ${{ secrets.tb_admin_token }} \
202-
release promote \
203-
--semver $VERSION
204-
205-
release_rollback:
206-
if: ${{ inputs.tb_deploy && github.event.workflow_dispatch }}
207-
runs-on: ubuntu-latest
208-
defaults:
209-
run:
210-
working-directory: ${{ inputs.data_project_dir }}
211-
needs: [push_changes]
212-
steps:
213-
- uses: actions/checkout@master
214-
- uses: actions/setup-python@v3
215-
with:
216-
python-version: "3.8"
217-
architecture: "x64"
218-
219-
- name: Validate input
220-
run: |
221-
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token ([email protected])' associated to a user account and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
222-
223-
- name: Install Tinybird CLI
224-
run: |
225-
if [ -f "requirements.txt" ]; then
226-
pip install -r requirements.txt
227-
else
228-
pip install tinybird-cli
229-
fi
230-
231-
- name: Tinybird version
232-
run: tb --version
233-
234-
- name: Promote Release
235-
run: |
236-
source .tinyenv
237-
tb \
238-
--host ${{ secrets.tb_host }} \
239-
--token ${{ secrets.tb_admin_token }} \
240-
release rollback
241-
242-
release_rm:
243-
if: ${{ inputs.tb_deploy && github.event.workflow_dispatch }}
244-
runs-on: ubuntu-latest
245-
defaults:
246-
run:
247-
working-directory: ${{ inputs.data_project_dir }}
248-
needs: [push_changes]
249-
steps:
250-
- uses: actions/checkout@master
251-
- uses: actions/setup-python@v3
252-
with:
253-
python-version: "3.8"
254-
architecture: "x64"
255-
256-
- name: Validate input
257-
run: |
258-
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token ([email protected])' associated to a user account and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
259-
260-
- name: Install Tinybird CLI
261-
run: |
262-
if [ -f "requirements.txt" ]; then
263-
pip install -r requirements.txt
264-
else
265-
pip install tinybird-cli
266-
fi
267-
268-
- name: Tinybird version
269-
run: tb --version
270-
271-
- name: Promote Release
272-
run: |
273-
source .tinyenv
274-
tb \
275-
--host ${{ secrets.tb_host }} \
276-
--token ${{ secrets.tb_admin_token }} \
277-
release rm \
278-
--semver $VERSION

.github/workflows/release.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Tinybird Release
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
job_to_run:
7+
description: 'Select the job to run manually'
8+
required: true
9+
type: string
10+
default: 'promote'
11+
data_project_dir:
12+
description: "relative path of the folder containing the data project"
13+
required: false
14+
type: string
15+
default: .
16+
secrets:
17+
tb_admin_token:
18+
required: true
19+
tb_host:
20+
required: true
21+
22+
jobs:
23+
promote:
24+
if: inputs.job_to_run == 'promote'
25+
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
working-directory: ${{ inputs.data_project_dir }}
29+
steps:
30+
- uses: actions/checkout@master
31+
- uses: actions/setup-python@v3
32+
with:
33+
python-version: "3.8"
34+
architecture: "x64"
35+
36+
- name: Validate input
37+
run: |
38+
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token ([email protected])' associated to a user account and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
39+
- name: Install Tinybird CLI
40+
run: |
41+
if [ -f "requirements.txt" ]; then
42+
pip install -r requirements.txt
43+
else
44+
pip install tinybird-cli
45+
fi
46+
- name: Tinybird version
47+
run: tb --version
48+
49+
- name: Promote Release
50+
run: |
51+
source .tinyenv
52+
tb \
53+
--host ${{ secrets.tb_host }} \
54+
--token ${{ secrets.tb_admin_token }} \
55+
release promote \
56+
--semver $VERSION
57+
rollback:
58+
runs-on: ubuntu-latest
59+
if: inputs.job_to_run == 'rollback'
60+
defaults:
61+
run:
62+
working-directory: ${{ inputs.data_project_dir }}
63+
steps:
64+
- uses: actions/checkout@master
65+
- uses: actions/setup-python@v3
66+
with:
67+
python-version: "3.8"
68+
architecture: "x64"
69+
70+
- name: Validate input
71+
run: |
72+
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token ([email protected])' associated to a user account and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
73+
- name: Install Tinybird CLI
74+
run: |
75+
if [ -f "requirements.txt" ]; then
76+
pip install -r requirements.txt
77+
else
78+
pip install tinybird-cli
79+
fi
80+
- name: Tinybird version
81+
run: tb --version
82+
83+
- name: Promote Release
84+
run: |
85+
source .tinyenv
86+
tb \
87+
--host ${{ secrets.tb_host }} \
88+
--token ${{ secrets.tb_admin_token }} \
89+
release rollback
90+
rm:
91+
runs-on: ubuntu-latest
92+
if: inputs.job_to_run == 'rm'
93+
defaults:
94+
run:
95+
working-directory: ${{ inputs.data_project_dir }}
96+
steps:
97+
- uses: actions/checkout@master
98+
- uses: actions/setup-python@v3
99+
with:
100+
python-version: "3.8"
101+
architecture: "x64"
102+
103+
- name: Validate input
104+
run: |
105+
[[ "${{ secrets.tb_admin_token }}" ]] || { echo "Go to the tokens section in your Workspace, copy the 'admin token ([email protected])' associated to a user account and set TB_ADMIN_TOKEN as a Secret in your Git repository"; exit 1; }
106+
- name: Install Tinybird CLI
107+
run: |
108+
if [ -f "requirements.txt" ]; then
109+
pip install -r requirements.txt
110+
else
111+
pip install tinybird-cli
112+
fi
113+
- name: Tinybird version
114+
run: tb --version
115+
116+
- name: Promote Release
117+
run: |
118+
source .tinyenv
119+
tb \
120+
--host ${{ secrets.tb_host }} \
121+
--token ${{ secrets.tb_admin_token }} \
122+
release rm \
123+
--semver $VERSION

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Next Release
22
=============
33

4+
- Fix manual jobs for v3 releases on GitHub
5+
6+
47
v2.3.0
58
======
69

0 commit comments

Comments
 (0)