-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (85 loc) · 4.61 KB
/
bump.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
name: bump
on:
workflow_dispatch:
inputs:
stream-target-version:
description: 'Stream target version for the update'
required: false
stream-source-version:
description: 'Stream source version for the update, required if Stream target version is specified'
required: false
horizon-target-version:
description: 'Horizon target version for the update'
required: false
horizon-source-version:
description: 'Horizon source version for the update, required if Horizon target version is specified'
required: false
permissions:
contents: write
pull-requests: write
jobs:
bumper:
runs-on: ubuntu-latest
env:
BASE_CLONE_URL: https://evertrust:${{ secrets.CI_TOKEN }}@github.com/evertrust/
steps:
- name: Get root absolute path
run: |
cd ..
echo "ROOT_PATH=$(pwd)" >> $GITHUB_ENV
- name: Cloning Playground
uses: actions/checkout@v4
- name: Get repository absolute path
run: echo "REPO_PATH=$(pwd)" >> $GITHUB_ENV
- name: Get current date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Display values
run: |
echo "ROOT_PATH: ${{ env.ROOT_PATH }}"
echo "REPO_PATH: ${{ env.REPO_PATH }}"
echo "DATE: ${{ env.DATE }}"
- name: Cloning Stream
if: ${{ inputs.stream-target-version }}
run: |
cd ${{ env.ROOT_PATH }}
git clone -b v${{ inputs.stream-target-version }} "${{ env.BASE_CLONE_URL }}/stream.git"
- name: Cloning Horizon
if: ${{ inputs.horizon-target-version }}
run: |
cd ${{ env.ROOT_PATH }}
git clone -b v${{ inputs.horizon-target-version }} "${{ env.BASE_CLONE_URL }}/horizon.git"
- name: Running upgrade for both Horizon and Stream
if: ${{ inputs.stream-target-version && inputs.horizon-target-version }}
run: |
${{ env.REPO_PATH }}/.build/upgrade.sh --stm_path ${{ env.ROOT_PATH }}/stream --hrz_path /home/runner/work/playground/horizon --hrz_source_version ${{ inputs.horizon-source-version }} --hrz_target_version ${{ inputs.horizon-target-version }} --stm_source_version ${{ inputs.stream-source-version }} --stm_target_version ${{ inputs.stream-target-version }} --playground_path ${{ env.REPO_PATH }}
- name: Running upgrade for Stream
if: ${{ inputs.stream-target-version && !inputs.horizon-target-version }}
run: |
${{ env.REPO_PATH }}/.build/upgrade.sh --stm_path ${{ env.ROOT_PATH }}/stream --stm_source_version ${{ inputs.stream-source-version }} --stm_target_version ${{ inputs.stream-target-version }} --playground_path ${{ env.REPO_PATH }}
- name: Running upgrade for Horizon
if: ${{ inputs.horizon-target-version && !inputs.stream-target-version }}
run: ${{ env.REPO_PATH }}/.build/upgrade.sh --hrz_path ${{ env.ROOT_PATH }}/horizon --hrz_source_version ${{ inputs.horizon-source-version }} --hrz_target_version ${{ inputs.horizon-target-version }} --playground_path ${{ env.REPO_PATH }}
- name: Grant rights
run: |
sudo chown -R $USER:$USER ${{ env.REPO_PATH }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
if: ${{ inputs.stream-target-version && inputs.stream-source-version &&!inputs.horizon-target-version }}
with:
title: Update Playground ${{ env.DATE }}
commit-message: Update Playground with Stream from v${{ inputs.stream-source-version }} to v${{ inputs.stream-target-version }}
branch: update-playgrounnd-${{ env.DATE }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
if: ${{ inputs.horizon-target-version && inputs.horizon-source-version && !inputs.stream-target-version }}
with:
title: Update Playground ${{ env.DATE }}
commit-message: Update Playground with Horizon from v${{ inputs.horizon-source-version }} to v${{ inputs.horizon-target-version }}
branch: update-playground-${{ env.DATE }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
if: ${{ inputs.stream-target-version && inputs.stream-source-version && inputs.horizon-target-version && inputs.horizon-source-version }}
with:
title: Update Playground ${{ env.DATE }}
commit-message: Update Playground with Stream from v${{ inputs.stream-source-version }} to v${{ inputs.stream-target-version }} and Horizon from v${{ inputs.horizon-source-version }} to v${{ inputs.horizon-target-version }}
branch: update-playground-${{ env.DATE }}