-
Notifications
You must be signed in to change notification settings - Fork 44
55 lines (50 loc) · 2.08 KB
/
staging-step-2.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
name: 'Staging Release - Step 2: Publish SDK Release to Release Order Branch'
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Do a dry run to preview instead of a real release [true/false]'
required: true
type: boolean
default: true
releaseOrderBranch:
description: 'Which Release Order Branch are you targeting? [release-order-a/release-order-b/release-order-c]'
required: true
type: choice
options:
- release-order-a
- release-order-b
- release-order-c
jobs:
verify-release-order-branch:
name: Verify Release Order Branch
runs-on: ubuntu-latest
steps:
# As a safe guard, if a valid release branch does not exist,
# this step will fail and throw an error
- name: Checkout Release Order (${{ github.event.inputs.releaseOrderBranch }})
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.releaseOrderBranch }}
push-release-branch:
name: Release staging to ${{ github.event.inputs.releaseOrderBranch}}
needs:
- verify-release-order-branch
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
GIT_AUTHOR_NAME: mparticle-automation
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: mparticle-automation
GIT_COMMITTER_EMAIL: [email protected]
steps:
- name: Checkout staging branch
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: ${{ github.repository }}
ref: staging
- name: Push to ${{ github.event.inputs.releaseOrderBranch }}
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
git push origin HEAD:${{ github.event.inputs.releaseOrderBranch }}