Skip to content

Commit

Permalink
A0-1932: Extend push-foundation-repo workflow to push release branche…
Browse files Browse the repository at this point in the history
…s and tags (#901)

* Extend push-foundation-repo workflow to push release branches and tags

* Change 'git push' command to use URL instead of adding mirror

* Fixed version of actions/checkout

* Change libssl version in cliain.

---------

Co-authored-by: Piotr K <piotr.kusinski@cardinals.cc>
Co-authored-by: Michal Swietek <4404982+mike1729@users.noreply.github.com>
Co-authored-by: Michal Swietek <mike1729@users.noreply.github.com>
  • Loading branch information
4 people authored and Marcin-Radecki committed Feb 27, 2023
1 parent 31644ea commit 6389158
Showing 1 changed file with 66 additions and 4 deletions.
70 changes: 66 additions & 4 deletions .github/workflows/push-foundation-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,78 @@ name: Sync Cardinal-Cryptography repo with Aleph-Zero-Foundation repo

on:
push:
branches: [main]
branches:
- main
- release-**
tags:
- r-*

jobs:
sync:
sync-main:
runs-on: ubuntu-20.04
if: ${{ github.repository == 'Cardinal-Cryptography/aleph-node'}}
if: github.repository == 'Cardinal-Cryptography/aleph-node' && startsWith(github.ref, 'refs/heads/') && github.ref_name == 'main'
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.SYNCAZF }}

- name: Push to Aleph-Zero-Foundation
run: git push https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git


sync-release-branch:
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@v3
with:
fetch-depth: 0
token: ${{ secrets.SYNCAZF }}

- name: Get branch name and commit SHA
id: get_branch
shell: bash
env:
HEAD_REF: ${{ github.ref }}
run: |
echo branch_name=$(echo ${HEAD_REF#refs/heads/}) >> $GITHUB_OUTPUT
echo sha_short=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Push to Aleph-Zero-Foundation
run: |
git push 'https://x-access-token:${{ secrets.SYNCAZF }}@github.com/aleph-zero-foundation/aleph-node.git' ${{ steps.get_branch.outputs.branch_name }}:${{ steps.get_branch.outputs.branch_name }}
sync-release-tag:
runs-on: ubuntu-20.04
if: github.repository == 'Cardinal-Cryptography/aleph-node' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get tag name and commit SHA
id: get_branch
shell: bash
env:
HEAD_REF: ${{ github.ref }}
run: |
echo tag_name=$(echo ${HEAD_REF#refs/tags/}) >> $GITHUB_OUTPUT
echo sha_short=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Checkout Aleph-Zero-Foundation repository
uses: actions/checkout@v3
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_branch.outputs.sha_short }}"
git tag "${{ steps.get_branch.outputs.tag_name }}"
git push origin "${{ steps.get_branch.outputs.tag_name }}"

0 comments on commit 6389158

Please sign in to comment.