Skip to content

feat(lighthouse)!: release stable with v7 beta as it's urgent #63

feat(lighthouse)!: release stable with v7 beta as it's urgent

feat(lighthouse)!: release stable with v7 beta as it's urgent #63

Workflow file for this run

name: Release on Tag
on:
push:
tags:
- '*-[v]?[0-9]+.[0-9]+.[0-9]+'
- '*-[v]?[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
# Allow to run the workflow from GitHub UI and other workflows.
workflow_call:
inputs:
tag:
type: string
required: true
description: "Triggering tag"
workflow_dispatch:
jobs:
init:
runs-on: ubuntu-latest
permissions:
contents: write # for creating releases
outputs:
name: ${{ steps.parse_tag.outputs.name }}
version: ${{ steps.parse_tag.outputs.version }}
prerelease: ${{ steps.parse_tag.outputs.prerelease }}
tag: ${{ steps.parse_tag.outputs.tag }}
steps:
- name: Parse tag
id: parse_tag
run: |
if [ -n "${{ inputs.tag }}" ]; then
tag="${{ inputs.tag }}"
else
tag="${{ github.ref_name }}"
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
name=$(echo "$tag" | sed -r 's/^(.*)-([v]?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)(-canary.)?([[:digit:]]+)?$/\1/g')
echo "name=$name" >> $GITHUB_OUTPUT
version=$(echo "$tag" | sed -r 's/^(.*)-([v]?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)(-canary.)?([[:digit:]]+)?$/\2/g')
echo "version=$version" >> $GITHUB_OUTPUT
prerelease=$(echo "$tag" | sed -r 's/^(.*)-([v]?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)(-canary.)?([[:digit:]]+)?$/\4/g')
echo "prerelease=$prerelease" >> $GITHUB_OUTPUT
update-changelog:
runs-on: ubuntu-latest
permissions:
contents: write # for updating changelog
needs:
- init
if: ${{ (needs.init.outputs.prerelease == '') && (false) }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: "main"
- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
- name: Setup node
uses: actions/setup-node@v3
- name: Yarn prepare scripts
run: |
corepack enable
corepack yarn prepare
- name: Get chart name
id: chart_name
run: |
name="$(echo ${{ needs.init.outputs.tag }} | sed -E 's/(.*)-[[:digit:]]+.[[:digit:]]+.[[:digit:]]+/\1/g')"
echo "name=$name" >> $GITHUB_OUTPUT
- name: Generate changelog and commit
env:
CHART: ${{ steps.chart_name.outputs.name }}
run: |
export GIT_CLIFF__GIT__TAG_PATTERN="$CHART-*"
export GIT_CLIFF__GIT__IGNORE_TAGS="$CHART-v?[0-9]+.[0-9]+.[0-9]+-.*"
yarn git-cliff -c ".cliff.toml" --include-path "charts/$CHART/**" -o "charts/$CHART/CHANGELOG.md"
git add "charts/$CHART/CHANGELOG.md"
git commit -m "ci(changelog): Update CHANGELOG for $CHART" --no-verify
git push
call-release:
uses: ./.github/workflows/make-chart-release.yaml
permissions:
contents: write # for updating index.yaml
needs:
- init
with:
tag: ${{ needs.init.outputs.tag }}
check-release-stream:
runs-on: ubuntu-latest
outputs:
repo: ${{ steps.check-release-stream.outputs.repo }}
steps:
- name: check-release-stream
id: check-release-stream
run: |
version=$(echo "${{ needs.init.outputs.tag }}" | sed -r 's/.*-([0-9]+\.[0-9]+\.[0-9]+.*)/\1/g')
if [[ "$version" == *"-canary"* ]]; then
release_stream="canary"
else
release_stream="stable"
fi
echo "repo=${release_stream}" >> $GITHUB_OUTPUT
call-update-helm-repo:
needs:
- call-release
- check-release-stream
uses: ./.github/workflows/update-helm-repo.yaml
permissions:
contents: write # for updating index.yaml
if: ${{ needs.check-release-stream.outputs.repo == 'canary' }}
with:
repo: canary