Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Generate release version
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Wendland committed Jul 4, 2024
1 parent 42e2271 commit cf794eb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,14 @@ jobs:
yq e -i '.version = "'$major.$minor.$patch'"' charts/$c/Chart.yaml
done
- name: generate docs
run:
docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest

- name: Commit files
continue-on-error: true
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git status
echo commit
git commit -m "Update helm documentation" -a
git commit -m "Update helm chart versions" -a
echo status update
git status
Expand Down
54 changes: 52 additions & 2 deletions .github/workflows/release-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,57 @@ on:

jobs:

deploy:
generate-version:
name: "Generate version"
runs-on: ubuntu-latest

outputs:
version: ${{ steps.out.outputs.version }}

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk

- id: pr
uses: actions-ecosystem/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Match semver label via bash
id: match-label-bash
run: |
LABELS=$(cat <<-END
${{ steps.pr.outputs.labels }}
END
)
IFS='\n' read -ra LABEL <<< "$LABELS"
for i in "${LABEL[@]}"; do
case $i in
# Will just use the first occurence
'major'|'minor'|'patch')
echo "RELEASE_LABEL=$i" >> $GITHUB_OUTPUT
break
esac
done
- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.match-label-bash.outputs.RELEASE_LABEL }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Set version output
id: out
run: echo "::set-output name=version::$(echo ${VERSION})"

deploy:
name: "Release charts"
needs:
- "generate-version"
runs-on: ubuntu-latest

steps:
Expand All @@ -35,7 +84,8 @@ jobs:
CR_SKIP_EXISTING: true

git-release:
needs: ["deploy"]
name: "Create Git Release"
needs: ["generate-version", "deploy"]
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit cf794eb

Please sign in to comment.