Skip to content

Commit

Permalink
Merge pull request #26 from github/simplify-release-workflows
Browse files Browse the repository at this point in the history
Collapse release workflows into one workflow
  • Loading branch information
malancas authored Jun 10, 2024
2 parents da878a0 + f106409 commit 1d3756c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 49 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/policies-release.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/policy-controller-release.yml

This file was deleted.

18 changes: 7 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: Release

on:
workflow_call:
inputs:
chart_name:
type: string
required: true
chart_release:
type: string
required: true
push:
tags:
- policy-controller-v*
- github-artifact-attestation-policy-v*

jobs:
release:
Expand All @@ -28,11 +24,11 @@ jobs:
run: |
# tag names are in the format <chart-name>-v<semantic-version>
# so we need to extract the chart name
release_name=$(echo -n ${{ inputs.chart_release }} | awk -F'-v' '{print $1}')
release_name=$(echo -n ${{ github.ref_name }} | awk -F'-v' '{print $1}')
echo release_name=$release_name >> $GITHUB_OUTPUT
# extract the version from the tag name
version=$(echo -n ${{ inputs.chart_release }} | sed "s/^$release_name-//")
version=$(echo -n ${{ github.ref_name }} | sed "s/^$release_name-//")
echo release_version=$version >> $GITHUB_OUTPUT
- name: Package Helm chart
run: helm package charts/${{ steps.release-details.outputs.release_name }}
Expand All @@ -43,7 +39,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push packaged chart to GHCR
run: helm push ${{ inputs.chart_name }}-${{ steps.release-details.outputs.release_version }}.tgz oci://${{ env.REGISTRY }}/${{ github.repository }}
run: helm push ${{ github.ref_name }}.tgz oci://${{ env.REGISTRY }}/${{ github.repository }}
- uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3
- name: Get pushed chart digest
id: get-digest
Expand Down

0 comments on commit 1d3756c

Please sign in to comment.