Skip to content

Commit

Permalink
Add release logic
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Wilson <[email protected]>
  • Loading branch information
miles-w-3 committed Jan 9, 2025
1 parent 117333b commit fc1d4a0
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 250 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/publish-helm.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release Chart

on:
push:
branches:
- main

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Generate Chart
run: |
make helm-chart-generate
- name: Check for changes to generated helm chart
id: check_changes
run: |
git status --porcelain charts/ | grep -q "." && echo "changes=true" >> $GITHUB_OUTPUT || echo "changes=false" >> $GITHUB_OUTPUT
# If we generated a new helm chart, we need to commit it
# We need to do this step because our helm chart is not the source of truth, it's generated from starter
# Note that failing to do this doesn't break this release, but it can break future ones and make the release state confusing
- name: Commit generated chart
id: update_source
run: |
git pull
git add charts/
git commit -m "Generated chart for release"
git push
if: steps.check_changes.outputs.changes == 'true'

# Chart releaser will internally only run if there is a diff in charts,
# but we explicitly check to keep the chart releaser and our generates charts/ dir in sync
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: steps.check_changes.outputs.changes == 'true'
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gh-pages/
/bundle
/bundle_tmp*
/bundle.Dockerfile
/charts

/.cr-release-packages
.vscode/
__pycache__
Expand All @@ -17,4 +17,3 @@ site/
Dockerfile
requirements.yml
watches.yaml
Makefile.awx-operator
2 changes: 1 addition & 1 deletion .helm/starter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: The community-supported AWX Operator Helm Chart
name: awx-operator
type: application
# the current version of this helm chart
version: 0.1.0
version: 3.0.0
# The version of the awx-operator to install
appVersion: 2.19.1
Loading

0 comments on commit fc1d4a0

Please sign in to comment.