-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (69 loc) · 2.11 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
71
72
73
74
75
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
latest:
required: false
type: boolean
default: false
tag:
required: true
type: string
description: 'Release tag (chart and images)'
jobs:
set-variables:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set-vars.outputs.tag }}
latest: ${{ steps.set-vars.outputs.latest }}
steps:
- id: set-vars
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
INPUT_TAG: ${{ github.event.inputs.tag }}
INPUT_LATEST: ${{ github.event.inputs.latest }}
run: |
if [[ "$EVENT_NAME" == "push" && "$REF" == refs/tags/v* ]]; then
echo "Tag push event"
TAG="${REF##*/}"
LATEST="true"
else
echo "Workflow dispatch or other event"
TAG="$INPUT_TAG"
# Ensure INPUT_LATEST is 'true' or 'false' string
if [[ "$INPUT_LATEST" == "true" ]]; then
LATEST="true"
else
LATEST="false"
fi
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "latest=$LATEST" >> $GITHUB_OUTPUT
release-images:
needs: set-variables
uses: ./.github/workflows/release-images.yaml
with:
tag: ${{ needs.set-variables.outputs.tag }}
latest: '${{ fromJSON(needs.set-variables.outputs.latest) }}'
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
release-charts:
needs: [set-variables, release-images]
uses: ./.github/workflows/release-charts.yaml
with:
chart_tag: ${{ needs.set-variables.outputs.tag }}
images_tag: ${{ needs.set-variables.outputs.tag }}
latest: '${{ fromJSON(needs.set-variables.outputs.latest) }}'
secrets:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-typescript-sdk:
needs: release-charts
uses: ./.github/workflows/release-typescript-sdk.yaml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}