-
-
Notifications
You must be signed in to change notification settings - Fork 273
78 lines (77 loc) · 2.86 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
name: Release to Production
on:
workflow_dispatch:
inputs:
chart_version:
type: string
required: true
default: current
description: Set to 'current' to use currently deployed chart version or '0.x.y' to specify chart
jobs:
semantic-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.releaseVersion.outputs.releaseVersion }}
steps:
- uses: actions/checkout@v3
- run: npm install conventional-changelog-conventionalcommits
- uses: codfish/semantic-release-action@v2
id: semantic
with:
repository_url: ${{ github.repositoryUrl }}
plugins: |
[
['@semantic-release/commit-analyzer', {
"preset": "conventionalcommits",
"releaseRules": [
{"type": "static", "release": "patch"},
{"type": "chore", "release": "patch"},
{"type": "helm", "release": false}
]
}],
['@semantic-release/release-notes-generator', {
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "chore", "hidden": true},
{"type": "docs", "hidden": true},
{"type": "style", "hidden": true},
{"type": "refactor", "hidden": true},
{"type": "perf", "hidden": true},
{"type": "test", "hidden": true},
{"type": "static", "section": "Static Content"},
{"type": "helm", "hidden": true}
]
},
}],
['@semantic-release/github', {
"successComment": false,
"failTitle": false
}]
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: check version was generated
id: releaseVersion
run: |
if [[ -z "${{ steps.semantic.outputs.new_release_version }}" ]]; then
if [[ -z "$(git tag --points-at HEAD -l 'v*')" ]]; then
echo "No release version available"
exit 1
else
echo "releaseVersion=$(git tag --points-at HEAD -l 'v*')" >> $GITHUB_OUTPUT
fi
else
echo "releaseVersion=${{ steps.semantic.outputs.new_release_version }}" >> $GITHUB_OUTPUT
fi
- name: "Version Info:"
run: echo "${{ steps.releaseVersion.outputs.releaseVersion }}"
deploy:
needs: semantic-release
uses: ./.github/workflows/production-deploy.yaml
secrets: inherit
with:
version: ${{ needs.semantic-release.outputs.version }}
chart_version: ${{ inputs.chart_version }}