-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (63 loc) · 2.34 KB
/
release.yaml
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
name: Create release
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v1.0.0)"
required: true
type: string
latest:
description: "Whether to tag this release latest"
required: true
type: boolean
default: false
jobs:
tests:
name: Run tests
uses: ./.github/workflows/tests.yaml
verify-tag:
name: Verify tag
runs-on: ubuntu-latest
outputs:
# The prerelease part of the semver tag, if any. To be used in the release job.
prerelease: ${{ steps.parse-semver.outputs.prerelease }}
steps:
- uses: mukunku/tag-exists-action@v1.6.0
id: check-tag
with:
tag: ${{ github.event.inputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: fail if tag already exists
if: ${{ steps.check-tag.outputs.exists == 'true' }}
run: exit 1
- name: Validate semver
id: parse-semver
uses: booxmedialtd/ws-action-parse-semver@v1.4.7
with:
input_string: ${{ github.event.inputs.tag }}
version_extractor_regex: 'v(.*)$'
release:
name: Create a GH release
runs-on: ubuntu-latest
needs:
- tests
- verify-tag
steps:
- uses: ncipollo/release-action@v1
with:
body: |
#### Changes
See [changelog] for a complete list of changes.
[changelog]: https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md#${{ github.event.inputs.tag }}
#### Install CRDs from all channels
```shell
kustomize build github.com/${{ github.repository }}/config/crd/gateway-operator\?ref=${{ github.event.inputs.tag }} | kubectl apply -f -
kustomize build github.com/${{ github.repository }}/config/crd/ingress-controller\?ref=${{ github.event.inputs.tag }} | kubectl apply -f -
kustomize build github.com/${{ github.repository }}/config/crd/ingress-controller-incubator\?ref=${{ github.event.inputs.tag }} | kubectl apply -f -
```
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.tag }}
commit: ${{ github.sha }}
prerelease: ${{ needs.verify-tag.outputs.prerelease != '' }}
makeLatest: ${{ github.event.inputs.latest == 'true' }}