-
Notifications
You must be signed in to change notification settings - Fork 133
77 lines (74 loc) · 2.08 KB
/
release.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: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
type: string
sha:
description: 'SHA'
required: true
type: string
branch:
description: 'Branch'
required: true
type: choice
default: main
options:
- main
- pre-release
jobs:
staging:
runs-on: ubuntu-latest
steps:
- name: Setup bob
uses: hashicorp/action-setup-bob@v2
with:
github-token:
${{ secrets.BOB_GITHUB_TOKEN }}
- name: Promote to staging
env:
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
SHA: ${{ github.event.inputs.sha }}
BRANCH: ${{ github.event.inputs.branch }}
ENVIRONMENT: staging
run: |
bob trigger-promotion \
--product-name=terraform-ls \
--environment=terraform-ls-oss \
--org=hashicorp \
--repo=terraform-ls \
--slack-channel=C02AGQXCAF5 \
--product-version=$VERSION \
--sha=$SHA \
--branch=$BRANCH \
$ENVIRONMENT
production:
runs-on: ubuntu-latest
needs: staging
steps:
- name: Setup bob
uses: hashicorp/action-setup-bob@v2
with:
github-token:
${{ secrets.BOB_GITHUB_TOKEN }}
- name: Promote to production
env:
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
SHA: ${{ github.event.inputs.sha }}
BRANCH: ${{ github.event.inputs.branch }}
ENVIRONMENT: production
run: |
bob trigger-promotion \
--product-name=terraform-ls \
--environment=terraform-ls-oss \
--org=hashicorp \
--repo=terraform-ls \
--slack-channel=C02AGQXCAF5 \
--product-version=$VERSION \
--sha=$SHA \
--branch=$BRANCH \
$ENVIRONMENT