forked from pimcore/pimcore
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (71 loc) · 2.29 KB
/
sync-releases.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
name: Sync releases to CE from EE
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name'
required: true
type: string
release_body:
description: 'Release body contents'
required: true
type: string
release_name:
description: 'Release name'
required: true
type: string
sha:
description: 'SHA hash of the release tag or branch name'
required: true
type: string
rc_release:
description: 'Release is a release candidate'
required: false
type: boolean
patch_release:
description: 'Release is a patch release'
required: false
type: boolean
jobs:
check-tag-val:
env:
TAG_NAME: ${{ github.event.inputs.tag_name }}
RC_RELEASE: ${{ github.event.inputs.rc_release }}
PATCH_RELEASE: ${{ github.event.inputs.patch_release }}
REGEX_REGULAR: "^v[0-9]+\\.[0-9]+\\.[0-9]+$"
REGEX_RC: "^v[0-9]+\\.[0-9]+\\.[0-9]+-RC[0-9]+$"
REGEX_PATCH: "^v[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$"
if: github.repository == 'pimcore/ee-pimcore'
runs-on: ubuntu-latest
outputs:
isTagValid: ${{ steps.check.outputs.isTagValid }}
steps:
- name: Check tag format to accept major and minor and exclude patches
id: check
run: |
if [[ "$RC_RELEASE" == "true" ]]; then
REGEX=$REGEX_RC
elif [[ "$PATCH_RELEASE" == "true" ]]; then
REGEX=$REGEX_PATCH
else
REGEX=$REGEX_REGULAR
fi
if [[ "$TAG_NAME" =~ $REGEX ]]; then
echo "isTagValid=true" >> $GITHUB_OUTPUT
else
echo "isTagValid=false" >> $GITHUB_OUTPUT
echo "No valid release value found. Check input params" >> $GITHUB_STEP_SUMMARY
exit 1
fi
sync-release-to-ce:
needs: check-tag-val
if: github.repository == 'pimcore/ee-pimcore' && needs.check-tag-val.outputs.isTagValid == 'true'
uses: pimcore/workflows-centralized/.github/workflows/[email protected]
with:
tag_name: ${{ inputs.tag_name }}
release_body : ${{ inputs.release_body}}
release_name: ${{ inputs.release_name }}
sha: ${{ inputs.sha }}
target_repo: 'pimcore'
secrets:
token: ${{ secrets.SYNC_TOKEN }}