Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(workflows): split release workflow into two for SOC 2 compliance #88

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/creating_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create Release PR

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true

jobs:
create-release-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"

- name: Update Chart and Values Versions
run: |
sed -i "s/^version:.*/version: ${{ github.event.inputs.tag }}/" Chart.yaml
sed -i "s/^appVersion:.*/appVersion: '${{ github.event.inputs.tag }}'/" Chart.yaml
sed -i "s/^version:.*/version: ${{ github.event.inputs.tag }}/" values.yaml

- name: Commit changes
run: |
git checkout -b release/${{ github.event.inputs.tag }}
git add Chart.yaml values.yaml
git commit -m "chore(release): update to ${{ github.event.inputs.tag }}"
git push origin release/${{ github.event.inputs.tag }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore(release): update to ${{ github.event.inputs.tag }}"
branch: release/${{ github.event.inputs.tag }}
title: "Release ${{ github.event.inputs.tag }}"
body: "This PR updates the chart versions to ${{ github.event.inputs.tag }}."
labels: release
40 changes: 15 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: Release Charts
name: Release Charts on Merge

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true
default: '1.0.0'
pull_request:
types: [closed]
branches:
- main

jobs:
release:
permissions:
contents: write
release-on-merge:
if: >
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -21,23 +20,14 @@ jobs:

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"

- name: Lint Chart - Main chart
run: helm lint .
run: helm lint .

- name: Update Dependencies
run: helm dependency update .

- name: Update Chart and Values Versions
run: |
sed -i "s/^version:.*/version: ${{ github.event.inputs.tag }}/" Chart.yaml
sed -i "s/^appVersion:.*/appVersion: '${{ github.event.inputs.tag }}'/" Chart.yaml
sed -i "s/^version:.*/version: ${{ github.event.inputs.tag }}/" values.yaml
git add Chart.yaml values.yaml
git commit -m "chore(release): update chart, appVersion, and values versions to ${{ github.event.inputs.tag }}"
git push origin main
run: helm dependency update .

- name: Run chart-releaser
uses: helm/[email protected]
Expand All @@ -49,8 +39,8 @@ jobs:
- name: Deploy to GitHub Pages
run: |
git checkout gh-pages
git pull origin main --rebase --autostash
git pull origin main --rebase --autostash
helm repo index . --url https://getlago.github.io/charts
git add .
git commit -m "Update Helm repo index for tag ${{ github.event.inputs.tag }}"
git commit -m "Update Helm repo index after release"
git push origin gh-pages
Loading