mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 18:59:09 +00:00
Fix release workflows
- Check for dirty repository in release - Fix helm release workflow name - Rename dist dir to manifests as dist is used by goreleaser
This commit is contained in:
@@ -39,6 +39,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0 # It is required for GoReleaser to work properly
|
fetch-depth: 0 # It is required for GoReleaser to work properly
|
||||||
|
|
||||||
|
- name: Install modules
|
||||||
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: check git status
|
||||||
|
run: git --no-pager diff --exit-code
|
||||||
# Set up BuildKit Docker container builder to be able to build
|
# Set up BuildKit Docker container builder to be able to build
|
||||||
# multi-platform images and export cache
|
# multi-platform images and export cache
|
||||||
# https://github.com/docker/setup-buildx-action
|
# https://github.com/docker/setup-buildx-action
|
||||||
|
|||||||
+45
-15
@@ -1,4 +1,4 @@
|
|||||||
name: Release Helm Chart and Carvel package
|
name: Release Helm Chart
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,28 +9,58 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
chart-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CHART_BASE_DIR: helm
|
||||||
|
GH_PAGES_BRANCH: gh-pages
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3.1.0
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Set ENVs
|
||||||
|
id: env-setup
|
||||||
run: |
|
run: |
|
||||||
|
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
git config user.name "$GITHUB_ACTOR"
|
git config user.name "$GITHUB_ACTOR"
|
||||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Install Helm
|
- name: Package Charts
|
||||||
uses: azure/setup-helm@v3.4
|
run: |
|
||||||
with:
|
# Package charts
|
||||||
version: v3.4.2
|
mkdir -p charts/.ci-build
|
||||||
|
echo "Setting chart version to ${{ steps.env-setup.outputs.CHART_VERSION }}"
|
||||||
|
|
||||||
- name: Run chart-releaser
|
for DIR in $CHART_BASE_DIR/*; do
|
||||||
uses: helm/chart-releaser-action@v1.4.1
|
# Check if Chart.yaml exists in this directory
|
||||||
|
if [ -f "${DIR}/Chart.yaml" ]; then
|
||||||
|
echo "Packaging ${DIR}"
|
||||||
|
helm dependency update $DIR
|
||||||
|
helm lint $DIR
|
||||||
|
helm package $DIR --destination charts/.ci-build
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
git fetch --all
|
||||||
|
|
||||||
|
- name: Upload chart artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
charts_dir: helm
|
name: helm-charts-${{ github.ref_name }}
|
||||||
env:
|
path: charts/.ci-build/*
|
||||||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
retention-days: 30
|
||||||
CR_RELEASE_NAME_TEMPLATE: "helm-v{{ .Version }}"
|
|
||||||
|
- name: Publish to GH-Pages
|
||||||
|
id: ghpublish
|
||||||
|
run: |
|
||||||
|
git checkout $GH_PAGES_BRANCH --force
|
||||||
|
helm repo index charts/.ci-build/ --merge index.yaml --url ${{ github.server_url }}/${{github.repository}}/releases/download/${{ github.ref_name }}
|
||||||
|
cp charts/.ci-build/index.yaml index.yaml
|
||||||
|
echo "New index:" && cat index.yaml
|
||||||
|
git add index.yaml charts
|
||||||
|
git commit -a -m "bot: update pages index for helm charts"
|
||||||
|
git push origin $GH_PAGES_BRANCH
|
||||||
@@ -125,8 +125,8 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
|
|||||||
|
|
||||||
.PHONY: build-installer
|
.PHONY: build-installer
|
||||||
build-installer: manifests ## Generate a consolidated YAML with CRDs and deployment.
|
build-installer: manifests ## Generate a consolidated YAML with CRDs and deployment.
|
||||||
mkdir -p dist
|
mkdir -p manifests
|
||||||
$(HELM) template --include-crds netbird-operator helm/netbird-operator > dist/install.yaml
|
$(HELM) template --include-crds netbird-operator helm/netbird-operator > manifests/install.yaml
|
||||||
|
|
||||||
##@ Deployment
|
##@ Deployment
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ This operator enables easily provisioning NetBird access on kubernetes clusters,
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
kubectl create namespace netbird
|
kubectl create namespace netbird
|
||||||
kubectl apply -n netbird -f https://github.com/netbirdio/kubernetes-operator/releases/latest/dist/install.yaml
|
kubectl apply -n netbird -f https://github.com/netbirdio/kubernetes-operator/releases/latest/manifests/install.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
**Using the Helm Chart**
|
**Using the Helm Chart**
|
||||||
@@ -38,7 +38,7 @@ helm show values netbirdio/netbird-operator
|
|||||||
**Using install.yaml**
|
**Using install.yaml**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
kubectl delete -n netbird -f https://github.com/netbirdio/kubernetes-operator/releases/latest/dist/install.yaml
|
kubectl delete -n netbird -f https://github.com/netbirdio/kubernetes-operator/releases/latest/manifests/install.yaml
|
||||||
kubectl delete namespace netbird
|
kubectl delete namespace netbird
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,41 @@ spec:
|
|||||||
status:
|
status:
|
||||||
description: NBSetupKeyStatus defines the observed state of NBSetupKey.
|
description: NBSetupKeyStatus defines the observed state of NBSetupKey.
|
||||||
properties:
|
properties:
|
||||||
ready:
|
conditions:
|
||||||
type: boolean
|
items:
|
||||||
|
description: NBSetupKeyCondition defines a condition in NBSetupKey
|
||||||
|
status.
|
||||||
|
properties:
|
||||||
|
lastProbeTime:
|
||||||
|
description: Last time we probed the condition.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
lastTransitionTime:
|
||||||
|
description: Last time the condition transitioned from one status
|
||||||
|
to another.
|
||||||
|
format: date-time
|
||||||
|
type: string
|
||||||
|
message:
|
||||||
|
description: Human-readable message indicating details about
|
||||||
|
last transition.
|
||||||
|
type: string
|
||||||
|
reason:
|
||||||
|
description: Unique, one-word, CamelCase reason for the condition's
|
||||||
|
last transition.
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
description: |-
|
||||||
|
Status is the status of the condition.
|
||||||
|
Can be True, False, Unknown.
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
description: Type is the type of the condition.
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- status
|
||||||
|
- type
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
@@ -132,6 +165,14 @@ rules:
|
|||||||
- get
|
- get
|
||||||
- patch
|
- patch
|
||||||
- update
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- pods
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
resources:
|
resources:
|
||||||
Reference in New Issue
Block a user