Skip to content

Commit

Permalink
add-changelog-to-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Nov 13, 2024
1 parent ce926f0 commit e6af637
Showing 1 changed file with 22 additions and 42 deletions.
64 changes: 22 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
required: false
type: boolean
default: false

jobs:
prod-container-build:
permissions:
Expand All @@ -24,18 +25,32 @@ jobs:
tag: ${{ inputs.tag }}
platforms: ${{ inputs.all_platforms && 'linux/amd64,linux/arm64' || 'linux/amd64' }}

create-changelog:
runs-on: ubuntu-latest
needs: prod-container-build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate Changelog
run: echo "# Release Changelog for ${GITHUB_REF_NAME}" > changelog.txt

- name: Upload Changelog as Artifact
uses: actions/upload-artifact@v4
with:
name: changelog
path: changelog.txt

create-github-release:
runs-on: ubuntu-latest
needs: [prod-container-build, package-helm-chart]
needs: [create-changelog, package-helm-chart]
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Download Helm Chart Artifact
- name: Download Changelog Artifact
uses: actions/download-artifact@v4
with:
name: helm-chart

name: changelog

- name: Upload Assets and Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down Expand Up @@ -71,6 +86,9 @@ jobs:
helm template oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}
```
### Changelog:
$(cat changelog.txt) # Includes the changelog content
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -98,44 +116,6 @@ jobs:
name: helm-chart
path: scality-cosi-driver-${{ inputs.tag }}.tgz

- name: Upload Assets and Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
docker-image-info.txt
scality-cosi-driver-${{ inputs.tag }}.tgz
tag_name: ${{ inputs.tag }}
name: Release ${{ inputs.tag }}
body: |
Release for tag ${{ inputs.tag }}
### Docker Image:
The Docker image for this release is available at:
```
ghcr.io/${{ github.repository_owner }}/cosi:${{ inputs.tag }}
```
### Helm Chart:
You can install the Helm chart using the following command:
```
helm install scality-cosi-driver oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}
```
### Helm Chart Details:
To view details of the chart:
```
helm show all oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}
```
### Template the Helm Chart:
To render the Helm templates:
```
helm template oci://ghcr.io/${{ github.repository }}/helm-charts/scality-cosi-driver --version ${{ inputs.tag }}
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push helm chart to ghcr.io
run: helm push scality-cosi-driver-${{ inputs.tag }}.tgz oci://ghcr.io/${{ github.repository }}/helm-charts

Expand Down

0 comments on commit e6af637

Please sign in to comment.