ci(.github): remove unecessary workflow file from release-2.1 (#12439) #9976
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Helm Charts" | |
# This workflow provides two things: | |
# On explicit dispatch, it packages, uploads and releases the chart to the | |
# charts repo. | |
# It uses the appVersion and version as present in Chart.yaml. | |
# On push to master, it packages and uploads a helm chart for the pushed commit. | |
# It updates both appVersion and version to be specific to this commit. | |
# See tools/release/helm.sh#dev_version | |
# This workflow can be tested by any owner with a fork of kumahq/kuma and kumahq/charts | |
on: | |
push: | |
branches: | |
- master | |
- release-* | |
pull_request: {} | |
workflow_dispatch: | |
inputs: | |
release: | |
description: Release charts | |
required: false | |
default: false | |
type: boolean | |
env: | |
CR_VERSION: 1.3.0 | |
GH_USER: "github-actions[bot]" | |
GH_EMAIL: "<41898282+github-actions[bot]@users.noreply.github.com>" | |
GH_OWNER: ${{ github.repository_owner }} | |
GITHUB_APP: "true" | |
jobs: | |
package: | |
name: Package | |
runs-on: ubuntu-latest | |
outputs: | |
filename: ${{ steps.package.outputs.filename }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Install dependencies | |
run: | | |
curl -L "https://github.com/helm/chart-releaser/releases/download/v${CR_VERSION}/chart-releaser_${CR_VERSION}_linux_amd64.tar.gz" | sudo tar xvz --directory /usr/bin cr | |
make dev/tools | |
git checkout go.* | |
- name: Update chart versions | |
run: | | |
git config user.name "${GH_USER}" | |
git config user.email "${GH_EMAIL}" | |
args="--update-version" | |
if [[ ${{ github.event_name }} == "push" ]]; then | |
args="${args} --dev" | |
fi | |
./tools/releases/helm.sh ${args} | |
git add -u deployments/charts | |
# This commit never ends up in the repo | |
git commit -m "ci(helm): update versions" | |
- name: Package chart | |
id: package | |
run: | | |
./tools/releases/helm.sh --package | |
PKG_FILENAME=$(find .cr-release-packages -type f -printf "%f\n") | |
echo "::set-output name=filename::${PKG_FILENAME}" | |
- name: Upload packaged chart | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.package.outputs.filename }} | |
path: .cr-release-packages/${{ steps.package.outputs.filename }} | |
retention-days: ${{ github.event_name == 'pull_request' && 1 || 30 }} | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: package | |
environment: charts | |
# https://github.com/actions/runner/issues/1483 | |
if: github.event.inputs.release == 'true' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install chart-releaser | |
run: | |
curl -L "https://github.com/helm/chart-releaser/releases/download/v${CR_VERSION}/chart-releaser_${CR_VERSION}_linux_amd64.tar.gz" | |
| sudo tar xvz --directory /usr/bin cr | |
- name: Download packaged chart | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ needs.package.outputs.filename }} | |
path: .cr-release-packages | |
- name: Generate GitHub app token | |
id: github-app-token | |
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c # v1.7.0 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
repository: ${{ env.GH_OWNER }}/charts | |
- name: Release chart | |
env: | |
GH_TOKEN: ${{ steps.github-app-token.outputs.token }} | |
run: ./tools/releases/helm.sh --release |