-
Notifications
You must be signed in to change notification settings - Fork 111
57 lines (57 loc) · 2.03 KB
/
Copy pathcreate-release.yml
File metadata and controls
57 lines (57 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Create Release
on:
pull_request:
push:
branches:
- main
jobs:
create_release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
# use this PAT to have other workflows triggered
github_token: ${{ secrets.GH_RELEASE_PAT }}
dry_run: ${{ github.event_name == 'pull_request' }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' }}
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Output generated version information
run: |
{ echo "# Tag ${{ steps.tag_version.outputs.new_tag }}"
echo ""
echo "## Release Notes"
echo "${{ steps.tag_version.outputs.changelog }}"
} >> "$GITHUB_STEP_SUMMARY"
update_helm_chart:
runs-on: ubuntu-latest
needs: create_release
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Strip leading "v" from version
id: strip_version
run: |
# shellcheck disable=SC2016
echo "STRIP_VERSION=$(php -r 'echo (str_starts_with($argv[1], "v") ? substr($argv[1], 1) : $argv[1]);' ${{ needs.create_release.outputs.new_tag }})" >> "$GITHUB_OUTPUT"
- name: Update Helm chart
uses: shini4i/helm-charts-updater@v1
with:
github_token: ${{ secrets.CHARTS_REPO_TOKEN }}
gh_user: jeboehm
gh_repo: mailserver-charts
chart_name: docker-mailserver
app_version: ${{ steps.strip_version.outputs.STRIP_VERSION }}
generate_docs: true
update_readme: true