mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
ci: Rework publishing CI (#381)
This commit is contained in:
parent
b8c2eca310
commit
c94a28baa3
10 changed files with 512 additions and 274 deletions
118
.github/workflows/charts-release.yaml
vendored
118
.github/workflows/charts-release.yaml
vendored
|
@ -1,92 +1,88 @@
|
|||
---
|
||||
name: "Charts: Release"
|
||||
|
||||
concurrency: helm-release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
charts:
|
||||
description: >
|
||||
Charts to release. Comma-separated string.
|
||||
Defaults to releasing everything.
|
||||
default: ""
|
||||
required: false
|
||||
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "charts/**"
|
||||
|
||||
env:
|
||||
HELM_VERSION: 3.11.2
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
prepare-release:
|
||||
name: Prepare data required for release
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
libraryChartsToRelease: ${{ steps.collect-charts.outputs.chartsLibraryToRelease }}
|
||||
applicationChartsToRelease: ${{ steps.collect-charts.outputs.chartsApplicationToRelease }}
|
||||
repoConfiguration: ${{ steps.repo-config.outputs.config }}
|
||||
libraryChartsToRelease: ${{ steps.changed-library-charts.outputs.all_changed_files }}
|
||||
applicationChartsToRelease: ${{ steps.changed-charts.outputs.all_changed_files }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Collect charts to release
|
||||
uses: bjw-s/helm-charts-actions/collect-charts@main
|
||||
id: collect-charts
|
||||
- name: Grab repository configuration
|
||||
id: repo-config
|
||||
shell: bash
|
||||
run: |
|
||||
echo "config=$(yq '.' '.ci/repo-config.yaml' -o json -I=0)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Get changed library charts
|
||||
id: changed-library-charts
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
repoConfigFile: ./.ci/repo-config.yaml
|
||||
overrideCharts: "[${{ inputs.charts }}]"
|
||||
requireHeadAheadOfBase: false
|
||||
matrix: true
|
||||
path: charts
|
||||
dir_names: true
|
||||
dir_names_max_depth: 2
|
||||
files: |
|
||||
library/**
|
||||
|
||||
- name: Get changed charts
|
||||
id: changed-charts
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
matrix: true
|
||||
path: charts
|
||||
dir_names: true
|
||||
dir_names_max_depth: 2
|
||||
files_ignore: |
|
||||
library/**
|
||||
|
||||
release-library-charts:
|
||||
name: Release Library charts to GitHub pages
|
||||
uses: ./.github/workflows/charts-release-ghpages.yaml
|
||||
name: Release library charts
|
||||
needs:
|
||||
- prepare
|
||||
- prepare-release
|
||||
if: ${{ needs.prepare-release.outputs.libraryChartsToRelease != '[]' }}
|
||||
uses: ./.github/workflows/charts-release-steps.yaml
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
contents: write
|
||||
packages: write
|
||||
with:
|
||||
charts: "${{ needs.prepare.outputs.libraryChartsToRelease }}"
|
||||
secrets: inherit
|
||||
charts: ${{ needs.prepare-release.outputs.libraryChartsToRelease }}
|
||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare-release.outputs.repoConfiguration).excluded-charts-release) }}
|
||||
ghPagesBranch: gh-pages
|
||||
publishToOciRegistry: false
|
||||
|
||||
tag-library-charts:
|
||||
name: Create git tags for library charts
|
||||
uses: ./.github/workflows/tag-charts.yaml
|
||||
release-other-charts:
|
||||
name: Release other charts
|
||||
needs:
|
||||
- prepare
|
||||
- prepare-release
|
||||
- release-library-charts
|
||||
if: ${{ needs.prepare-release.outputs.applicationChartsToRelease != '[]' }}
|
||||
uses: ./.github/workflows/charts-release-steps.yaml
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
contents: write
|
||||
packages: write
|
||||
with:
|
||||
charts: "${{ needs.prepare.outputs.libraryChartsToRelease }}"
|
||||
secrets: inherit
|
||||
|
||||
release-application-charts:
|
||||
name: Release Application charts to GitHub pages
|
||||
uses: ./.github/workflows/charts-release-ghpages.yaml
|
||||
needs:
|
||||
- prepare
|
||||
- release-library-charts
|
||||
with:
|
||||
charts: "${{ needs.prepare.outputs.applicationChartsToRelease }}"
|
||||
secrets: inherit
|
||||
|
||||
tag-application-charts:
|
||||
name: Create git tags for application charts
|
||||
uses: ./.github/workflows/tag-charts.yaml
|
||||
needs:
|
||||
- prepare
|
||||
- release-application-charts
|
||||
with:
|
||||
charts: "${{ needs.prepare.outputs.applicationChartsToRelease }}"
|
||||
secrets: inherit
|
||||
|
||||
release-github-oci:
|
||||
name: Release Application charts to GitHub Container Registry
|
||||
uses: ./.github/workflows/charts-release-oci.yaml
|
||||
needs:
|
||||
- prepare
|
||||
- release-library-charts
|
||||
with:
|
||||
charts: "${{ needs.prepare.outputs.applicationChartsToRelease }}"
|
||||
secrets: inherit
|
||||
charts: ${{ needs.prepare-release.outputs.applicationChartsToRelease }}
|
||||
excludedChartsRelease: ${{ toJSON(fromJSON(needs.prepare-release.outputs.repoConfiguration).excluded-charts-release) }}
|
||||
ghPagesBranch: gh-pages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue