Skip to content

Commit

Permalink
Trying a better publishing mechanism.
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Layfield <aaron.layfield@gmail.com>
  • Loading branch information
DandyDeveloper committed Feb 25, 2025
1 parent 8274932 commit d240e73
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ on:
branches: [ master ]

jobs:
release:
prepare:
runs-on: ubuntu-latest

permissions:
contents: write
packages: write
runs-on: ubuntu-latest

outputs:
changed_charts: ${{ steps.chart-releaser.outputs.changed_charts }}
version: ${{ steps.chart-releaser.outputs.chart_version }}

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -21,8 +27,10 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.12.0

- name: Install Helm Deps
run: |
Expand All @@ -35,12 +43,21 @@ jobs:
uses: helm/chart-releaser-action@v1.7.0
env:
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true

- name: Run chart-releaser (OCI)
uses: appany/helm-oci-chart-releaser@v0.3.0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
repository: dandydeveloper
tag: ${{ steps.chart-releaser.outputs.chart_version }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.CR_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.CR_TOKEN }}

- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
done

0 comments on commit d240e73

Please sign in to comment.