-
Notifications
You must be signed in to change notification settings - Fork 58
90 lines (78 loc) · 2.89 KB
/
push-foundation-repo.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
---
name: Sync Cardinal-Cryptography repo with Aleph-Zero-Foundation repo
on:
push:
branches:
- main
- 'release-*'
tags:
- 'r-*'
jobs:
check-vars-and-secrets:
name: Check vars and secrets
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit
sync-main:
needs: [check-vars-and-secrets]
runs-on: ubuntu-20.04
if: >
github.repository == 'Cardinal-Cryptography/aleph-node' &&
startsWith(github.ref, 'refs/heads/') &&
github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SYNCAZF }}
- name: Push to Aleph-Zero-Foundation
# yamllint disable-line rule:line-length
run: git push 'https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git'
sync-release-branch:
needs: [check-vars-and-secrets]
runs-on: ubuntu-20.04
if: >
github.repository == 'Cardinal-Cryptography/aleph-node' &&
startsWith(github.ref, 'refs/heads/') &&
startsWith(github.ref_name, 'release-')
steps:
- name: GIT | Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SYNCAZF }}
- name: Call action get-ref-properties
id: get-ref-properties
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v5
- name: Push to Aleph-Zero-Foundation
# yamllint disable rule:line-length
run: |
git push \
'https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git' \
${{ steps.get-ref-properties.outputs.branch }}:${{ steps.get-ref-properties.outputs.branch}}
# yamllint disable rule:line-length
sync-release-tag:
needs: [check-vars-and-secrets]
runs-on: ubuntu-20.04
if: github.repository == 'Cardinal-Cryptography/aleph-node' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Call action get-ref-properties
id: get-ref-properties
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v5
- name: Checkout Aleph-Zero-Foundation repository
uses: actions/checkout@v4
with:
repository: aleph-zero-foundation/aleph-node
token: ${{ secrets.SYNCAZF }}
path: aleph-zero-foundation-aleph-node
fetch-depth: 0
- name: Checkout commit SHA and add tag in Aleph-Zero-Foundation repository
run: |
cd aleph-zero-foundation-aleph-node/
git checkout '${{ steps.get-ref-properties.outputs.sha }}'
git tag '${{ steps.get-ref-properties.outputs.tag }}'
git push origin '${{ steps.get-ref-properties.outputs.tag }}'