forked from tailscale/tailscale
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.72 KB
/
publish-chart.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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Charts: Publish to GHCR OCI"
on:
workflow_dispatch: {}
pull_request:
branches: ["coreweave"]
types: ["opened", "synchronize", "reopened"]
paths:
- .github/workflows/publish-chart.yaml
- "**/*"
push:
branches:
- coreweave
paths:
- .github/workflows/publish-chart.yaml
- "**/*"
jobs:
publish-charts:
name: Publish chart
permissions:
contents: write
packages: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set VERSION from VERSION.txt
id: set_version
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV
- name: Set HELM_VERSION
run: echo "HELM_VERSION=v${{ env.VERSION }}-${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Helm
uses: azure/setup-helm@v4
- name: Package CRDs
shell: bash
run: |
cp -r cmd/k8s-operator/deploy/crds cmd/k8s-operator/deploy/chart
- name: Package & Push Helm Charts
shell: bash
if: ${{ always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
run: |
helm package cmd/k8s-operator/deploy/chart --dependency-update --version ${{ env.HELM_VERSION }} --app-version ${{ env.HELM_VERSION }}
pkg=$(ls tailscale-operator-*.tgz)
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}/chart