Skip to content

v0.1.2-beta.0

v0.1.2-beta.0 #12

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
publish-hpm-image:
if: startsWith(github.ref, 'refs/tags/v') == true
runs-on: ubuntu-22.04
permissions:
id-token: write # This is the key for OIDC!
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: sigstore/[email protected]
with:
cosign-release: "v2.2.3"
- id: get_version
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
echo "::set-output name=release_version::$RELEASE_VERSION"
- name: Get Docker tags
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
loftsh/vcluster-hpm
ghcr.io/loft-sh/vcluster-hpm
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- 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: Build and push the image
id: docker_build
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Sign Container DockerHub Image
run: |
COSIGN_EXPERIMENTAL=1 cosign sign --yes loftsh/vcluster-hpm@${{ steps.docker_build.outputs.digest }}
- name: Sign Container ghcr.io Image
run: |
COSIGN_EXPERIMENTAL=1 cosign sign --yes ghcr.io/loft-sh/vcluster-hpm@${{ steps.docker_build.outputs.digest }}
publish-chart:
if: startsWith(github.ref, 'refs/tags/v') == true
needs: [publish-hpm-image]
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" chart/hpm/ chartmuseum
env:
CHART_MUSEUM_URL: "https://charts.loft.sh/"
CHART_MUSEUM_USER: ${{ secrets.CHART_MUSEUM_USER }}
CHART_MUSEUM_PASSWORD: ${{ secrets.CHART_MUSEUM_PASSWORD }}