|
@@ -0,0 +1,68 @@
|
|
|
+name: after_release
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ tags:
|
|
|
+ - "v**"
|
|
|
+jobs:
|
|
|
+ charts:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v2
|
|
|
+ with:
|
|
|
+ fetch-depth: 1
|
|
|
+ - run: |
|
|
|
+ git config user.name github-actions
|
|
|
+ git config user.email github-actions@github.com
|
|
|
+ - uses: azure/setup-helm@v1
|
|
|
+ - name: update appVersion
|
|
|
+ run: |
|
|
|
+ export version=${GITHUB_REF##*/}
|
|
|
+ sed -i "s/appVersion:.*/appVersion: ${version}/" charts/kafka-ui/Chart.yaml
|
|
|
+ - name:
|
|
|
+ run: |
|
|
|
+ export VERSION=${GITHUB_REF##*/}
|
|
|
+ MSG=$(helm package --app-version ${VERSION} charts/kafka-ui)
|
|
|
+ git fetch origin
|
|
|
+ git stash
|
|
|
+ git checkout -b gh-pages origin/gh-pages
|
|
|
+ helm repo index .
|
|
|
+ git add -f ${MSG##*/} index.yaml
|
|
|
+ git commit -m "release ${VERSION}"
|
|
|
+ git push
|
|
|
+ gh-release:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v2
|
|
|
+ with:
|
|
|
+ fetch-depth: 0
|
|
|
+ - run: |
|
|
|
+ git config user.name github-actions
|
|
|
+ git config user.email github-actions@github.com
|
|
|
+ - id: generate
|
|
|
+ shell: /usr/bin/bash -x -e {0}
|
|
|
+ run: |
|
|
|
+ VERSION=${GITHUB_REF##*/}
|
|
|
+ CHANGELOG=$(git --no-pager log --oneline --pretty=format:"- %s" `git tag --sort=-creatordate | grep '^v.*' | head -n2 | tail -n1`.. | uniq | grep -v '^- Merge\|^- skip')
|
|
|
+ CHANGELOG="${CHANGELOG//'%'/'%25'}"
|
|
|
+ CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
|
|
|
+ CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
|
|
|
+ echo ${CHANGELOG}
|
|
|
+ echo "::set-output name=changelog::${CHANGELOG}"
|
|
|
+ echo "::set-output name=version::${VERSION}"
|
|
|
+ - id: create_release
|
|
|
+ uses: actions/github-script@v3
|
|
|
+ env:
|
|
|
+ CHANGELOG: ${{steps.generate.outputs.changelog}}
|
|
|
+ VERSION: ${{steps.generate.outputs.version}}
|
|
|
+ with:
|
|
|
+ github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
+ script: |
|
|
|
+ github.repos.createRelease({
|
|
|
+ owner: context.repo.owner,
|
|
|
+ repo: context.repo.repo,
|
|
|
+ tag_name: context.ref,
|
|
|
+ name: "Release "+process.env.VERSION,
|
|
|
+ body: process.env.CHANGELOG,
|
|
|
+ draft: false,
|
|
|
+ prerelease: false
|
|
|
+ });
|