-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (49 loc) · 2.14 KB
/
official-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
name: "Create CARTO SelfHosted official release"
on:
release:
types: [prereleased, released]
jobs:
helm-package:
timeout-minutes: 3
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Obtain release info
id: release-info
run: |
if [ "${{ github.event.action }}" == "prereleased" ]; then
yq -i '.version = .version + "-beta"' chart/Chart.yaml
yq -i '.spec.chart.chartVersion = .spec.chart.chartVersion + "-beta"' manifests/kots-helm.yaml
echo "channel-name=Release candidates" >> "$GITHUB_OUTPUT"
echo "version=$(yq .version -r chart/Chart.yaml)" >> "$GITHUB_OUTPUT"
else
echo "channel-name=Stable" >> "$GITHUB_OUTPUT"
echo "version=$(yq .version -r chart/Chart.yaml)" >> "$GITHUB_OUTPUT"
fi
- name: Publish release
uses: ./.github/actions/publish-release
with:
replicated-channel: ${{ steps.release-info.outputs.channel-name }}
version: ${{ steps.release-info.outputs.version }}
release-notes: "CARTO Self-Hosted ${{ steps.release-info.outputs.version }}"
trigger-action: ${{ github.event.action }}
gcloud-service-account: ${{ secrets.CARTO_ARTIFACTS_SERVICE_ACCOUNT }}
replicated-api-token: ${{ secrets.REPLICATED_API_TOKEN }}
- name: Slack notification
if: github.event.action == 'released'
env:
SLACK_CHANNEL: C02PADFM0E4 # #carto-selfhosted
JOB_STATUS: ${{ job.status }}
run: |
if [ 'success' == "${JOB_STATUS}" ];then
status_emoji=:rocket:
else
status_emoji=:x:
fi
curl -F "text=${status_emoji} Self Hosted Release \`${{ github.event.release.tag_name }}\` published:
- *<https://github.com/CartoDB/carto-selfhosted-helm/releases|Releases>*
- *<https://vendor.replicated.com/apps/carto/channels|Channels>*" \
-F "channel=${SLACK_CHANNEL}" \
-H "Authorization: Bearer ${{ secrets.SLACK_KEY }}" \
-X POST https://slack.com/api/chat.postMessage