Merge pull request #184 from mozilla/reuseable_workflow

New post release workflow for hubs cloud packages
This commit is contained in:
Brandon Patterson 2023-01-05 16:22:23 -05:00 коммит произвёл GitHub
Родитель 161ce60bfc aef587fa15
Коммит 2625595fd6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 52 добавлений и 0 удалений

52
.github/workflows/HcPkgPreReleaseGitops.yaml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,52 @@
name: compare branches
on:
workflow_call:
inputs:
main:
description: "Main Branch"
required: true
type: string
releaseTrackingBranch:
description: "releasing Branch"
required: true
type: string
qaTestBranch:
description: "Qa test branch"
required: true
type: string
jobs:
launch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: |
echo "prep work"
git fetch origin ${{inputs.releaseTrackingBranch}
git fetch origin ${{inputs.qatestBranch}}
tag="hc.test.$(date '+%y-%m-%d')"
echo "$tag"
echo "point hubs-cloud to current qa-test"
git reset HEAD --hard
git checkout ${{inputs.qaTestBranch}}
git pull origin ${{inputs.qaTestBranch}}
sha=$(git rev-parse HEAD)
echo "${{inputs.qaTestBranch}} branch sha: $sha"
git checkout ${{inputs.releaseTrackingBranch}}
git update-ref 'refs/heads/${{inputs.releaseTrackingBranch}}' $sha
git push origin ${{inputs.releaseTrackingBranch}}
echo "point qa-test branch to current master"
git reset HEAD --hard
git checkout ${{inputs.main}}
sha=$(git rev-parse HEAD)
echo "master branch sha: $sha"
git checkout ${{inputs.releaseTrackingBranch}}
git update-ref 'refs/heads/${{inputs.releaseTrackingBranch}}' $sha
git push origin ${{inputs.releaseTrackingBranch}} -f
git tag $tag
git push origin $tag