Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Pure helm

Pure helm #6

name: Pre-Release
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
jobs:
generate-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.out.outputs.version }}
steps:
- uses: actions/checkout@v2
- id: bump
uses: zwaldowski/match-label-action@v1
with:
allowed: major,minor,patch
- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get PR Number
id: pr_number
run: echo "::set-output name=nr::$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')"
- name: Set version output
id: out
run: echo "::set-output name=version::$(echo ${VERSION}-PRE-${{ steps.pr_number.outputs.nr }})"
deploy:
needs: [ "generate-version" ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# See https://github.com/helm/chart-releaser-action/issues/6
- name: Install Helm
run: |
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
# prepare yaml parser
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install yq
run: |
pip3 install yq
yq -V
- name: Generate Chart.yaml
run: |
./generate.sh ${{ needs.generate-version.outputs.version }}
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
git-release:
needs: ["generate-version","deploy"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ needs.generate-version.outputs.version }}
prerelease: true
title: ${{ needs.generate-version.outputs.version }}
files: |
LICENSE