Skip to content

Commit

Permalink
feat: add helm chart to the release pipeline (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Nov 13, 2024
1 parent 2428ea6 commit 247bfb4
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,23 @@ jobs:
java-version: 21
distribution: temurin
cache: maven
- name: Prepare application.yaml
- name: Install YQ
run: |
# Install yq
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
chmod +x /usr/bin/yq
# Prepare application.yaml
- name: Prepare application.yaml
run: |
yq e -P -i '.related.image.server=strenv(IMAGE_SERVER)' src/main/resources/application.yaml
yq e -P -i '.related.image.db=strenv(IMAGE_DB)' src/main/resources/application.yaml
env:
IMAGE_SERVER: ${{ github.event.inputs.image-server }}
IMAGE_DB: ${{ github.event.inputs.image-db }}
- name: Prepare Chart.yaml
run: |
NEW_VERSION=$NEW_VERSION yq e -i '.version=strenv(NEW_VERSION)' helm/Chart.yaml
NEW_VERSION=$NEW_VERSION yq e -i '.appVersion=strenv(NEW_VERSION)' helm/Chart.yaml
env:
NEW_VERSION: ${{ github.event.inputs.version }}
- name: Set release version ${{ github.event.inputs.version }}
run: |
mvn -B versions:set versions:commit -DnewVersion=$NEW_VERSION
Expand All @@ -51,7 +56,7 @@ jobs:
uses: trustification/release-tools/.github/actions/commit@main
with:
commit_message: "🏁 Releasing version ${{ github.event.inputs.version }}"
branch: main
branch: ${{github.ref_name}}

release:
needs: [ prepare ]
Expand Down Expand Up @@ -82,25 +87,30 @@ jobs:
with:
name: jreleaser-log
path: 'jreleaser-log.tgz'
- name: Restore application.yaml
- name: Install YQ
run: |
# Install yq
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
chmod +x /usr/bin/yq
# Prepare application.yaml
- name: Restore application.yaml
run: |
yq e -P -i '.related.image.server="${RELATED_IMAGE_SERVER:ghcr.io/trustification/trustd:latest}"' src/main/resources/application.yaml
yq e -P -i '.related.image.db="${RELATED_IMAGE_DB:quay.io/sclorg/postgresql-15-c9s:latest}"' src/main/resources/application.yaml
- name: Restore Chart.yaml
run: |
NEXT_VERSION=$NEXT_VERSION yq e -i '.version=strenv(NEXT_VERSION)' helm/Chart.yaml
yq e -i '.appVersion="latest"' helm/Chart.yaml
env:
NEXT_VERSION: ${{ github.event.inputs.next }}
- name: Set version ${{ github.event.inputs.next }}
run: |
mvn -B versions:set versions:commit -DnewVersion=$NEW_VERSION
mvn -B versions:set versions:commit -DnewVersion=$NEXT_VERSION
env:
NEW_VERSION: ${{ github.event.inputs.next }}
NEXT_VERSION: ${{ github.event.inputs.next }}
- name: Commit and Push
uses: trustification/release-tools/.github/actions/commit@main
with:
commit_message: "⬆️ Next version ${{ github.event.inputs.next }}"
branch: main
branch: ${{github.ref_name}}

publish-bundle:
needs: [ release ]
Expand Down

0 comments on commit 247bfb4

Please sign in to comment.