Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/fake-services-release-unstable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: fake-services-release-unstable

env:
APP_DIR: applications/fake-services
APP_SLUG: gerard-helm-fake-service

on:
push:
branches:
- main
- '*gerard*'
paths:
- 'applications/fake-services/**'

jobs:
push-to-replicated:
runs-on: ubuntu-22.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use ubuntu-latest?


defaults:
run:
working-directory: ${{ env.APP_DIR }}

steps:
- uses: actions/checkout@v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use actions/checkout@v4

with:
fetch-depth: 0

- name: Set release version
id: set-release-version
run: |
git_hash=$(git rev-parse --short HEAD)
date_version=$(date -u '+%Y.%-m.%-d-%H%M%S')
version="${date_version}-Unstable-${git_hash}"
echo "VERSION=${version}" >> $GITHUB_ENV

- name: Package Helm chart
id: package-helm-chart
run: |
helm package ./app --debug -u -d ./replicated \
--version ${{ env.VERSION }} \
--app-version ${{ env.VERSION }}

- name: Install yq
run: |
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq &&\
chmod +x /usr/local/bin/yq

- name: Update HelmChart kind
run: |
yq -i '.spec.chart.chartVersion = "${{ env.VERSION }}"' ./replicated/kots-chart.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use sed, then no need install yq

like sed -i "s/\(chartVersion: \).*/\1$VERSION/" your-file.yaml


- name: Create Replicated release
id: create-release
uses: replicatedhq/compatibility-actions/create-release@v1
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
yaml-dir: ./replicated
promote-channel: Unstable
version: ${{ env.VERSION }}

outputs:
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
release-sequence: ${{ steps.create-release.outputs.release-sequence }}
app-version: ${{ env.VERSION }}
2 changes: 1 addition & 1 deletion applications/fake-services/replicated/kots-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
title: Message
type: text
required: true
default: Today is Christmas Eve! Ho Ho Ho! DO NOT USE CUSTOM DOMAIN YET!
default: Test Github Action in platform-examples
- name: frontend_log_level
title: Log level
type: radio
Expand Down