-
-
Notifications
You must be signed in to change notification settings - Fork 277
47 lines (46 loc) · 1.58 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
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
- uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
extra_plugins: |
@semantic-release/[email protected]
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 }}