-
Notifications
You must be signed in to change notification settings - Fork 5
196 lines (166 loc) · 6.62 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Release
on:
push:
branches:
- main
- master
jobs:
analyze-commits:
runs-on: ubuntu-latest
outputs:
version-next: ${{ steps.next-version.outputs.release-version }}
version-next-tag: ${{ steps.next-version.outputs.release-tag }}
version-next-type: ${{ steps.next-version.outputs.release-type }}
steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: audit
allowed-endpoints: >
github.com:443
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
- name: "Setup Node"
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #4.1.0
with:
node-version: 20
- name: Install dependencies
run: yarn global add semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/exec @semantic-release/release-notes-generator @semantic-release/commit-analyzer conventional-changelog-conventionalcommits
- name: Get next version
id: next-version
run: semantic-release --dryRun
env:
GITHUB_TOKEN: ${{ secrets.WEAREFRANK_BOT_PAT }}
GH_TOKEN: ${{ secrets.WEAREFRANK_BOT_PAT }}
ci:
uses: wearefrank/ci-cd-templates/.github/workflows/ci-generic.yml@5abb5d1df24669c4c4ef75093bb83161c359c66e #1.0.10
needs: analyze-commits
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ needs.analyze-commits.outputs.version-next-type != '' }}
with:
version: ${{ needs.analyze-commits.outputs.version-next }}
docker-image-repo: ${{ vars.DOCKER_IMAGE_REPOSITORY }}
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }}
upload-sarif-to-security: false
run-frank-till-healthy-enabled: false
run-soapui-tests:
runs-on: ubuntu-latest
needs:
- analyze-commits
- ci
steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
- name: Download Docker tar
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #4.1.8
with:
name: build-docker-image
- name: Load Docker tar
shell: bash
run: |
docker load --input image.tar
docker image ls -a
- name: Run SoapUI Tests
run: |
export ZAAKBRUG_VERSION="${{ needs.analyze-commits.outputs.version-next }}"
docker image inspect ${{ vars.DOCKER_IMAGE_REPOSITORY }}/${{ vars.DOCKER_IMAGE_NAME }}:${ZAAKBRUG_VERSION}
docker compose -f ./docker-compose.zaakbrug.dev.yml -f ./docker-compose.zaakbrug.postgres.yml -f ./docker-compose.openzaak.dev.yml --profile soapui up -d
docker ps
sleep 90
STATUS=$(docker inspect --format='{{json .State.Status}}' soapui-testrunner)
until [ "$STATUS" = '"exited"' ]
do
STATUS=$(docker inspect --format='{{json .State.Status}}' soapui-testrunner)
sleep 15
done
EXIT_CODE=$(docker inspect --format='{{json .State.ExitCode}}' soapui-testrunner)
echo "Exit Code: $EXIT_CODE"
docker compose -f ./docker-compose.zaakbrug.dev.yml -f ./docker-compose.zaakbrug.postgres.yml -f ./docker-compose.openzaak.dev.yml down
if [ "$EXIT_CODE" -ne 0 ]
then
echo "Test(s) failed. Failing the job."
exit 1
fi
timeout-minutes: 15
- name: Check if test reports created
run: |
if [ -z "$(ls -A e2e/reports)" ]
then
echo "There is no test report found, tests might not have been run. Failing the job."
exit 1
fi
- name: Upload SoapUI testreports as artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #4.4.3
if: always()
with:
name: reports-soapui-testreports
path: ./*/reports
release:
runs-on: ubuntu-latest
needs:
- analyze-commits
- ci
- run-soapui-tests
steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
with:
token: ${{ secrets.WEAREFRANK_BOT_PAT }}
- name: Download Pre-build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #4.1.8
with:
pattern: pre-build-*
merge-multiple: true
- name: Download Build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #4.1.8
with:
pattern: build-*
merge-multiple: true
- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #4.1.0
with:
node-version: 20
- name: Install dependencies
run: yarn global add semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/exec @semantic-release/release-notes-generator @semantic-release/commit-analyzer conventional-changelog-conventionalcommits
- name: Semantic Release
run: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.WEAREFRANK_BOT_PAT }}
GH_TOKEN: ${{ secrets.WEAREFRANK_BOT_PAT }}
docker-release:
uses: wearefrank/ci-cd-templates/.github/workflows/docker-release-generic.yml@5abb5d1df24669c4c4ef75093bb83161c359c66e #1.0.10
needs:
- analyze-commits
- release
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
with:
version: ${{ needs.analyze-commits.outputs.version-next }}
update-helm:
uses: ./.github/workflows/update-helm-chart.yml
needs:
- release
- analyze-commits
secrets:
token: ${{ secrets.WEAREFRANK_BOT_PAT }}
with:
version: ${{ needs.analyze-commits.outputs.version-next }}
docusaurus-release:
permissions:
contents: read
pages: write
id-token: write
needs:
- release
# Set to true to enable Docusaurus publishing to GitHub Pages
if: true
uses: wearefrank/ci-cd-templates/.github/workflows/docusaurus-release.yml@5abb5d1df24669c4c4ef75093bb83161c359c66e #1.0.10