mirror of
https://github.com/ysoftdevs/secret-duplicator.git
synced 2026-03-18 23:44:23 +01:00
Added release chart action
This commit is contained in:
50
.github/workflows/release-chart.yaml
vendored
Normal file
50
.github/workflows/release-chart.yaml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Release Charts
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
paths:
|
||||
- 'charts/**'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@v1
|
||||
with:
|
||||
version: v3.4.0
|
||||
|
||||
- name: Helm version checker
|
||||
id: helm_version_checker
|
||||
continue-on-error: true
|
||||
run: |
|
||||
helm repo add secret-duplicator https://ysoftdevs.github.io/secret-duplicator
|
||||
helm repo update
|
||||
|
||||
newVersion="$(helm show chart helm/secret-duplicator | grep version: | awk '{print $2}')"
|
||||
echo "Trying to upload version $newVersion"
|
||||
uploadedVersions="$(helm search repo secret-duplicator/secret-duplicator -l | tail -n +2 | awk '{print $2}')"
|
||||
echo "Found these versions in upstream: $uploadedVersions"
|
||||
for uploadedVersion in $uploadedVersions; do
|
||||
if [ "$newVersion" == "$uploadedVersion" ]; then
|
||||
echo "Found a matching version in upstream, failing this task and skipping the release"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "No matching version found, running the release"
|
||||
|
||||
- name: Run chart-releaser
|
||||
if: steps.helm_version_checker.outcome == 'success'
|
||||
uses: helm/chart-releaser-action@v1.2.1
|
||||
env:
|
||||
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||
Reference in New Issue
Block a user