41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
name: Workflow for Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'release/v*'
|
|
- 'hotfix/v*'
|
|
|
|
jobs:
|
|
sync-release-branch:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Git
|
|
run: |
|
|
git config user.name "github-actions"
|
|
git config user.email "actions@github.com"
|
|
|
|
- name: Fetch all history
|
|
run: git fetch --unshallow || git fetch --all
|
|
|
|
- name: Determine Tag Type
|
|
id: tagtype
|
|
run: |
|
|
if [[ ${{ github.ref }} == refs/tags/release/v* ]]; then
|
|
echo "::set-output name=type::release"
|
|
elif [[ ${{ github.ref }} == refs/tags/hotfix/v* ]]; then
|
|
echo "::set-output name=type::hotfix"
|
|
fi
|
|
|
|
- name: Check out the release branch
|
|
run: |
|
|
git checkout release || git checkout -b release
|
|
|
|
- name: Sync release branch to tag
|
|
run: |
|
|
git reset --hard ${{ github.ref }}
|
|
git push -f origin release
|