Skip to content

Goreleaser fix helm chart version from metadata #11

Goreleaser fix helm chart version from metadata

Goreleaser fix helm chart version from metadata #11

Workflow file for this run

# Fleet release workflow
name: Fleet release
on:
push:
tags:
- v**
permissions:
contents: write
packages: write
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_K3D_VERSION: 'v5.5.1'
jobs:
build-fleet:
runs-on: ubuntu-latest
steps:
- name: Check out Fleet
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: Run golangci-lint
uses: golangci/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always
# use the latest patch version.
version: v1.55
args: --timeout=10m --config=.golangci.json
- name: Run FOSSA scan
if: contains(github.ref, 'rc') != true
uses: fossas/[email protected]
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
- name: Run FOSSA tests
if: contains(github.ref, 'rc') != true
uses: fossas/[email protected]
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
- name: Check for code changes
run: |
./.github/scripts/check-for-auto-generated-changes.sh
go mod verify
- name: Run unit tests
run: go test -cover -tags=test $(go list ./... | grep -v -e /e2e -e /integrationtests)
- name: Run integration tests
env:
SETUP_ENVTEST_VER: v0.0.0-20240115093953-9e6e3b144a69
ENVTEST_K8S_VERSION: 1.28
run: ./.github/scripts/run-integration-tests.sh
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
id: goreleaser
with:
distribution: goreleaser
version: v1.24.0
args: release --clean --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload charts to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo: "ghcr.io/rancher"
tag: ${{ steps.goreleaser.outputs.metadata.tag }}
version: ${{ steps.goreleaser.outputs.metadata.version }}
run: |
echo "publishing helm chart for (repo: $repo, tag: $tag, version: $version)"
# Replace rancher/fleet, rancher/fleet-agent and rancher/gitjob image names, but not eg. rancher/kubectl
sed -i \
-e "s@repository: rancher/\(fleet.*\|gitjob\).*@repository: $repo/\\1@" \
-e "s/tag:.*/tag: $tag/" \
charts/fleet/values.yaml
sed -i \
-e "s@repository: rancher/\(fleet.*\|gitjob\).*@repository: $repo/\\1@" \
-e "s/tag: dev/tag: $tag/" \
charts/fleet-agent/values.yaml
helm package --version="$version" --app-version="$version" -d ./dist ./charts/fleet
helm package --version="$version" --app-version="$version" -d ./dist ./charts/fleet-crd
helm package --version="$version" --app-version="$version" -d ./dist ./charts/fleet-agent
for f in $(find dist/ -name '*.tgz'); do
gh release upload $tag $f
done