-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (61 loc) · 2.27 KB
/
Copy pathrelease.yaml
File metadata and controls
76 lines (61 loc) · 2.27 KB
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
name: Release
on:
workflow_dispatch:
push:
tags:
- '*'
permissions:
contents: read
env:
# renovate: datasource=github-releases depName=helm/helm
HELM_VERSION: v3.21.0
jobs:
metadata-collector:
uses: ./.github/workflows/metadata-collector.yaml
version-check:
uses: ./.github/workflows/version-check.yaml
chart:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
needs: [metadata-collector, version-check]
strategy:
fail-fast: false
matrix:
chart: ${{ fromJSON(needs.metadata-collector.outputs.charts) }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Helm
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
with:
version: ${{ env.HELM_VERSION }}
- name: Set up ORAS
uses: oras-project/setup-oras@38de303aac69abb66f3e6255b7198bff35f323e3 # v2.0.0
- name: Build Helm dependencies
run: scripts/helm-dependency-build.sh $CHART_NAME
env:
CHART_NAME: ${{ matrix.chart }}
- name: Publish Helm chart
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${GITHUB_ACTOR} --password-stdin
helm package charts/${CHART_NAME}
helm push "$(realpath ${CHART_NAME}-*.tgz)" oci://ghcr.io/${REPOSITORY_NAME}
helm registry logout ghcr.io
env:
REPOSITORY_NAME: ${{ github.repository }}
CHART_NAME: ${{ matrix.chart }}
- name: Update ArtifactHUB repo
if: ${{ hashFiles(format('charts/{0}/artifacthub-repo.yml', matrix.chart)) != '' }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io --username ${GITHUB_ACTOR} --password-stdin
oras push ghcr.io/${REPOSITORY_NAME}/${CHART_NAME}:artifacthub.io \
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
charts/${CHART_NAME}/artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
oras logout ghcr.io
env:
REPOSITORY_NAME: ${{ github.repository }}
CHART_NAME: ${{ matrix.chart }}