Merge pull request #20 from FIWARE/feat/use-dedicated-psql-user #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| 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/action-get-merged-pull-request@v1.0.1 | |
| 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 | |
| echo $i | |
| 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: minor | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set version output | |
| id: out | |
| run: echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| deploy: | |
| name: "Release charts" | |
| needs: | |
| - "generate-version" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Fetch history | |
| run: git fetch --prune --unshallow | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Install Helm | |
| run: | | |
| curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | |
| chmod 700 get_helm.sh | |
| ./get_helm.sh | |
| - name: Add repositories | |
| run: | | |
| for dir in $(ls -d charts/*/); do | |
| helm dependency list $dir 2> /dev/null | tail +2 | sed '$d' | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done | |
| done | |
| - name: Run chart-releaser | |
| uses: helm/chart-releaser-action@v1.5.0 | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| CR_SKIP_EXISTING: true | |
| git-release: | |
| name: "Create Git Release" | |
| needs: ["generate-version", "deploy"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Generate Table of contents | |
| uses: technote-space/toc-generator@v4 | |
| with: | |
| TARGET_PATHS: "./README.md,./doc/README.md" | |
| COMMIT_MESSAGE: "Update ToC" |