Skip to content

Commit 3f6eede

Browse files
committed
CD of a release creation
1 parent dcf1972 commit 3f6eede

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: 'CD of a release creation'
2+
3+
# For testing
4+
# on: pull_request
5+
on:
6+
schedule:
7+
- cron: '17 0 * * 2'
8+
9+
jobs:
10+
11+
12+
create-branch:
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- uses: actions/checkout@v4
17+
18+
- name: check if week number is even
19+
id: week
20+
run: |
21+
set -xe
22+
# if (( $(date +%U) % 2 == 0 )); then
23+
echo "even=true" >> $GITHUB_OUTPUT
24+
echo $GITHUB_OUTPUT
25+
# else
26+
# echo "even=false" >> $GITHUB_OUTPUT
27+
# fi
28+
29+
- name: create next RC branch
30+
if: ${{ steps.week.outputs.even == 'true' }}
31+
run: |
32+
set -xe
33+
NEW_BRANCH="release/2.$(date +"%Y" | tail -c4).$(date +"%U")"
34+
git config user.name "GitHub Actions Bot"
35+
git config user.email "[email protected]"
36+
git checkout -b $NEW_BRANCH
37+
git push origin $NEW_BRANCH
38+
39+
- name: delete previous RC branch if it hasn't a correspond tag
40+
run: |
41+
echo 'TODO, for now do it manually'
42+
43+
- name: squash migrations, if any
44+
run: |
45+
echo 'TODO, for now do it manually'
46+
47+
48+
on-failure:
49+
runs-on: ubuntu-22.04
50+
if: ${{ always() && (needs.create-branch.result == 'failure' || needs.create-branch.result == 'timed_out') }}
51+
needs:
52+
- create-branch
53+
steps:
54+
55+
- name: Send a stream message
56+
uses: zulip/github-actions-zulip/send-message@v1
57+
with:
58+
api-key: ${{ secrets.ZULIP_API_KEY_GITHUB_ACTIONS_BOT }}
59+
60+
organization-url: "https://chat.kobotoolbox.org"
61+
type: "stream"
62+
to: "Kobo Dev"
63+
topic: "Github Actions (CD)"
64+
content: ":warning: release candidate creation failed."

0 commit comments

Comments
 (0)