forked from pagopa/aks-cron-chart-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.98 KB
/
release.yml
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
58
59
60
61
62
63
64
65
66
67
68
name: Release
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
paths-ignore:
- 'CODEOWNERS'
- '**.md'
- 'example'
- 'util'
- 'bin'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
# issue: https://github.com/helm/chart-releaser-action/issues/113
- name: Force tags download
run: |
git pull --tags
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Semantic release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
dry_run: true
semantic_version: 18.0.0
extra_plugins: |
@semantic-release/release-notes-generator@10.0.3
@semantic-release/git@10.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump new version
if: steps.semantic.outputs.new_release_published == 'true'
run: |
yq -i ".version = \"${{ steps.semantic.outputs.new_release_version }}\"" "charts/cron-chart/Chart.yaml"
git add "charts/cron-chart/Chart.yaml"
git commit -m "Bumb cron chart version ${{ steps.semantic.outputs.new_release_version }}"
git push -u origin main
- name: Setup Helm
if: steps.semantic.outputs.new_release_published == 'true'
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Run chart-releaser
if: steps.semantic.outputs.new_release_published == 'true'
uses: helm/chart-releaser-action@v1.4.0
env:
CR_TOKEN: "${{ secrets.RELEASE_TOKEN }}"