This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (114 loc) · 4.06 KB
/
release-please.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
on:
push:
branches:
- main
permissions:
contents: read
name: release-please
jobs:
release-please:
permissions:
contents: write # google-github-actions/release-please-action
pull-requests: write # google-github-actions/release-please-action
actions: write # actions/upload-artifact
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_version: "${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}"
steps:
- uses: google-github-actions/release-please-action@c078ea33917ab8cfa5300e48f4b7e6b16606aede # v3.7.8
id: release
with:
release-type: node
package-name: garden-dev-cluster
extra-files: |
README.md
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: 18
if: ${{ steps.release.outputs.release_created }}
- name: Setup Cloud Formation Formatter
if: ${{ steps.release.outputs.release_created }}
run: |
mkdir -p rain/bin
cd rain
gh release download --repo aws-cloudformation/rain --pattern "*_linux-amd64.zip" --output "rain.zip"
cd bin
unzip -j ../rain.zip "*/rain"
echo "$PWD" >> "$GITHUB_PATH"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run cdk synth
if: ${{ steps.release.outputs.release_created }}
run: |
npm install
npm run synth
npm run rain
env:
CDK_RELEASE_VERSION: "${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}"
CDK_ENVIRONMENT: prod
- name: Archive release assets
if: ${{ steps.release.outputs.release_created }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: release-assets
path: |
cdk.out
*.template.yaml
upload-assets:
runs-on: ubuntu-latest
permissions:
contents: read # actions/checkout
id-token: write # aws-actions/configure-aws-credentials
actions: read # actions/download-artifact
strategy:
matrix:
region: [
"ap-northeast-1",
"ap-northeast-2",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"sa-east-1",
"us-east-1",
"us-east-2",
"us-west-2"
]
needs:
- release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
# these if statements ensure that a publication only occurs when
# a new release is created:
- uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2
with:
node-version: 18
- name: Download a single artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: release-assets
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # 2.0.0
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: github-action-dev-cluster-cdk-release
aws-region: ${{ matrix.region }}
- run: npm install
- run: npm run upload-assets
env:
AWS_REGION: ${{ matrix.region }}
- name: Publish the CloudFormation templates
if: ${{ matrix.region == 'eu-central-1' }}
run: |
npm run upload-templates
env:
CDK_RELEASE_VERSION: ${{ needs.release-please.outputs.release_version }}