-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (73 loc) · 2.11 KB
/
main-push.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
name: Push to main
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.GIT_TOKEN }}
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Trestle
run: bash scripts/automation/install_trestle.sh
- name: Release
run: source scripts/automation/release.sh
- name: Push the changes
run: bash scripts/automation/push.sh
downstream-repo-update:
name: Update downstream repositories
runs-on: ubuntu-latest
needs: release
steps:
- name: Check for initialized
id: file_check
run: |
if ls -l catalogs | wc -l != 0; then
echo "check_result=true" >> $GITHUB_OUTPUT
else
echo "check_result=false" >> $GITHUB_OUTPUT
fi
- name: Clone branch
if: steps.file_check.outputs.check_result == 'true'
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
token: ${{ secrets.GIT_TOKEN }}
- name: Clone downstream repo
if: steps.file_check.outputs.check_result == 'true'
uses: actions/checkout@v2
with:
repository: my-repo-base/my-profile
path: './my-profile'
token: ${{ secrets.GIT_TOKEN }}
fetch-depth: 0
- name: Update profiles
if: steps.file_check.outputs.check_result == 'true'
run: bash scripts/automation/update_downstream.sh
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN }}
merge-main-to-develop:
name: Merge main to develop
runs-on: ubuntu-latest
needs: release
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.job }}-main
cancel-in-progress: true
if: github.ref == 'refs/heads/main'
steps:
- uses: tukasz/direct-merge-action@master
with:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
source-branch: main
target-branch: develop
commit-message: "chore: Merge back version tags and changelog into develop."