Skip to content

v0.16.0-beta.4

v0.16.0-beta.4 #293

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
publish:
if: startsWith(github.ref, 'refs/tags/v') == true
name: Publish vcluster
runs-on: ubuntu-22.04
permissions:
id-token: write # This is the key for OIDC cosign!
packages: write
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v4
with:
cache: false
go-version: "1.21"
- name: Setup Just
uses: extractions/setup-just@v1
- name: Setup Cosgin
uses: sigstore/cosign-installer@main
with:
cosign-release: "v2.0.2"
- name: Setup Syft
uses: anchore/sbom-action/[email protected]
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: azure/setup-helm@v3
with:
version: "v3.0.2"
- id: get_version
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
echo "release_version=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
echo "previous_tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> "$GITHUB_OUTPUT"
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup GoReleaser nightly from source
run: go install github.com/goreleaser/goreleaser@962429de067b3f6cde8d377beaf3194b3b258075
- name: Run GoReleaser
run: goreleaser release --clean --timeout 60m
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
TELEMETRY_PRIVATE_KEY: ${{ secrets.VCLUSTER_TELEMETRY_PRIVATE_KEY }}
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.release_version }}
GORELEASER_PREVIOUS_TAG: ${{ steps.get_version.outputs.previous_tag }}
# - uses: "goreleaser/[email protected]"
# with:
# version: nightly
# args: release --clean --timeout 60m
# env:
# GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
# TELEMETRY_PRIVATE_KEY: ${{ secrets.VCLUSTER_TELEMETRY_PRIVATE_KEY }}
# GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.release_version }}
# GORELEASER_PREVIOUS_TAG: ${{ steps.get_version.outputs.previous_tag }}
- name: Save release assets
uses: actions/upload-artifact@v3
with:
name: release-assets
path: release/
- name: Attach assets to release
uses: FabianKramm/release-asset-action@v1
with:
pattern: "release/*"
github-token: ${{ secrets.GITHUB_TOKEN }}
publish-chart:
if: startsWith(github.ref, 'refs/tags/v') == true
needs: [publish]
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: azure/setup-helm@v3
with:
version: "v3.0.2"
- run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/v!!p')
helm plugin install https://github.com/chartmuseum/helm-push.git
helm repo add chartmuseum $CHART_MUSEUM_URL --username $CHART_MUSEUM_USER --password $CHART_MUSEUM_PASSWORD
helm cm-push --force --version="$RELEASE_VERSION" --app-version="$RELEASE_VERSION" charts/k3s/ chartmuseum
helm cm-push --force --version="$RELEASE_VERSION" --app-version="$RELEASE_VERSION" charts/k0s/ chartmuseum
helm cm-push --force --version="$RELEASE_VERSION" --app-version="$RELEASE_VERSION" charts/k8s/ chartmuseum
helm cm-push --force --version="$RELEASE_VERSION" --app-version="$RELEASE_VERSION" charts/eks/ chartmuseum
env:
CHART_MUSEUM_URL: "https://charts.loft.sh/"
CHART_MUSEUM_USER: ${{ secrets.CHART_MUSEUM_USER }}
CHART_MUSEUM_PASSWORD: ${{ secrets.CHART_MUSEUM_PASSWORD }}