-
Notifications
You must be signed in to change notification settings - Fork 24
91 lines (75 loc) · 3.34 KB
/
update-version.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
91
# This is a basic workflow that is manually triggered
# IMPORTANT!
# For this repo which contains AEPCore, AEPIdentity, AEPLifecycle, AEPServices, and AEPSignal, it is assumed
# that when the version is updated for AEPCore, all other extensions (excluding AEPServices) will also
# have their minimum dependencies updated to the same new version.
name: Update Versions
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
core-version:
description: 'New version to use for Core. Example: 3.0.2'
required: false
identity-version:
description: 'New version to use for Identity. Example: 3.0.2'
required: false
lifecycle-version:
description: 'New version to use for Lifecycle. Example: 3.0.2'
required: false
signal-version:
description: 'New version to use for Signal. Example: 3.0.2'
required: false
branch:
description: 'Branch to be used when updating versions'
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update-versions:
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.branch }}
- if: ${{ github.event.inputs.core-version != '' }}
name: Update Core Version
run: (sh ./scripts/update-versions.sh -n Core -v ${{ github.event.inputs.core-version }})
- if: ${{ github.event.inputs.identity-version != '' }}
name: Update Identity Version
run: (sh ./scripts/update-versions.sh -n Identity -v ${{ github.event.inputs.identity-version }})
- if: ${{ github.event.inputs.lifecycle-version != '' }}
name: Update Lifecycle Version
run: (sh ./scripts/update-versions.sh -n Lifecycle -v ${{ github.event.inputs.lifecycle-version }})
- if: ${{ github.event.inputs.signal-version != '' }}
name: Update Signal Version
run: (sh ./scripts/update-versions.sh -n Signal -v ${{ github.event.inputs.signal-version }})
- name: Generate Commit Message
shell: bash
run: |
COMMIT_MSG=""
if [ "${{ github.event.inputs.core-version }}" ]; then
COMMIT_MSG="[Core-${{ github.event.inputs.core-version }}]"
fi
if [ "${{ github.event.inputs.identity-version }}" ]; then
COMMIT_MSG="$COMMIT_MSG [Identity-${{ github.event.inputs.identity-version }}]"
fi
if [ "${{ github.event.inputs.lifecycle-version }}" ]; then
COMMIT_MSG="$COMMIT_MSG [Lifecycle-${{ github.event.inputs.lifecycle-version }}]"
fi
if [ "${{ github.event.inputs.signal-version }}" ]; then
COMMIT_MSG="$COMMIT_MSG [Signal-${{ github.event.inputs.signal-version }}]"
fi
echo $COMMIT_MSG
echo COMMIT_MSG=$COMMIT_MSG >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
delete-branch: true
commit-message: Update versions ${{ env.COMMIT_MSG }}
title: Update versions ${{ env.COMMIT_MSG }}
body: Update versions ${{ env.COMMIT_MSG }}
base: ${{ github.event.inputs.branch }}