-
Notifications
You must be signed in to change notification settings - Fork 3
164 lines (140 loc) · 5.23 KB
/
scaler-ci.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Scaler
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
jobs:
build:
name: Build
runs-on: windows-latest
outputs:
chartVersion: ${{ steps.chart.outputs.chartVersion }}
imageTag: ${{ steps.chart.outputs.imageTag }}
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Versions
id: chart
uses: ./.github/actions/parse-chart
- name: Build Scaler
uses: ./.github/actions/dotnet-publish
with:
assemblyVersion: ${{ steps.chart.outputs.assemblyVersion }}
azureClientId: ${{ secrets.AZURE_CLIENT_ID }}
azureCodeSigningAccountName: ${{ secrets.AZURE_CODESIGNING_NAME }}
azureSubscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azureTenantId: ${{ secrets.AZURE_TENANT_ID }}
buildConfiguration: Release
certificateProfileName: ${{ secrets.AZURE_CODESIGNING_PROFILE_NAME }}
fileVersion: ${{ steps.chart.outputs.assemblyFileVersion }}
repositoryUri: ${{ github.server_url }}/${{ github.repository }}
sign: 'true'
testResultsDirectory: ${{ runner.temp }}/TestResults
- name: Upload Code Coverage
uses: ./.github/actions/code-coverage
with:
codecovToken: ${{ secrets.CODECOV_TOKEN }}
reportPath: ${{ runner.temp }}/TestResults/*/coverage.cobertura.xml
validate:
name: Validate
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker Image
uses: ./.github/actions/docker-build
with:
copyBinaries: 'true'
imageRepository: ghcr.io/${{ github.repository }}
imageTag: ${{ needs.build.outputs.imageTag }}
- name: Validate Helm Chart
uses: ./.github/actions/helm-test
with:
buildConfiguration: Release
imageTag: ${{ needs.build.outputs.imageTag }}
scalerImageRepository: ghcr.io/${{ github.repository }}
- name: Pack Helm Chart
uses: ./.github/actions/helm-package
with:
chartPath: ${{ github.workspace }}/charts/durabletask-azurestorage-scaler
chartVersion: ${{ needs.build.outputs.chartVersion }}
gpgPassword: ${{ secrets.GPG_PASSWORD }}
gpgPrivateKey: ${{ secrets.GPG_PRIVATE_KEY_BASE64 }}
sign: 'true'
publishImage:
name: Publish Image
runs-on: ubuntu-latest
needs: validate
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Image
uses: actions/download-artifact@v4
with:
name: image
path: ${{ runner.temp }}/image
- name: Read Versions
id: chart
uses: ./.github/actions/parse-chart
- name: Push Docker Image
id: push
uses: ./.github/actions/docker-push
with:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
imageArchive: ${{ runner.temp }}/image/durabletask-azurestorage-scaler-${{ steps.chart.outputs.imageTag }}.tar
imageRepository: ghcr.io/${{ github.repository }}
imageTag: ${{ steps.chart.outputs.imageTag }}
pushLatest: ${{ steps.chart.outputs.imagePrerelease != 'true' }}
- name: Create Image Release
uses: ./.github/actions/github-release
if: ${{ steps.push.outputs.success == 'true' }}
with:
asset: ${{ runner.temp }}/image/durabletask-azurestorage-scaler-${{ steps.chart.outputs.imageTag }}.tar
name: 'Durable Task KEDA External Scaler Image'
prerelease: ${{ steps.chart.outputs.imagePrerelease }}
tag: 'Image_${{ steps.chart.outputs.imageTag }}.${{ steps.push.outputs.digest }}'
version: '${{ steps.chart.outputs.imageTag }}.${{ steps.push.outputs.digest }}'
publishChart:
name: Publish Chart
runs-on: ubuntu-latest
needs: publishImage
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Chart
uses: actions/download-artifact@v4
with:
name: chart
path: ${{ runner.temp }}/chart
- name: Read Versions
id: chart
uses: ./.github/actions/parse-chart
- name: Sync Chart
id: sync
uses: ./.github/actions/chart-sync
with:
assetPath: ${{ runner.temp }}/chart
chartRepositoryDirectoryName: 'releases'
chartRepositoryToken: ${{ secrets.CHART_REPO_PAT }}
chartVersion: ${{ steps.chart.outputs.chartVersion }}
logoPath: ${{ github.workspace }}/img/storm-icon.png
readmePath: ${{ github.workspace }}/charts/durabletask-azurestorage-scaler/README.md
- name: Create Chart Release
uses: ./.github/actions/github-release
if: ${{ steps.sync.outputs.success == 'true' }}
with:
asset: ${{ runner.temp }}/chart
name: 'Durable Task KEDA External Scaler Chart'
prerelease: ${{ steps.chart.outputs.chartPrerelease }}
tag: 'Chart_${{ steps.chart.outputs.chartVersion }}'
version: ${{ steps.chart.outputs.chartVersion }}