-
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (85 loc) · 2.48 KB
/
release.yml
File metadata and controls
99 lines (85 loc) · 2.48 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release 🎈
on:
push:
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
permissions: read-all
jobs:
chart-releaser:
name: Create Release 🥇
permissions:
contents: write
packages: write
defaults:
run:
shell: bash
runs-on: ubuntu-latest
steps:
- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v9.0.0
with:
strip_tag_prefix: v
- name: Checkout Repo 🛎
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set chart-releaser configuration ⚙️
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Override the default chart-releaser release name.
cat << EOF > chart-releaser-config.yaml
release-name-template: "v{{ .Version }}"
EOF
yq e -i '.version = "${{ steps.branch-name.outputs.tag }}"' helm/templates/Chart.yaml
yq e -i '.appVersion = "${{ steps.branch-name.outputs.tag }}"' helm/templates/Chart.yaml
- name: Run chart-releaser ⛵
uses: helm/chart-releaser-action@v1.7.0
with:
charts_dir: helm
config: chart-releaser-config.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# goreleaser runs in a separate job because it needs a clean git state.
goreleaser:
needs: chart-releaser
name: Run goreleaser 🐹
permissions:
contents: write
packages: write
defaults:
run:
shell: bash
runs-on: ubuntu-latest
steps:
- name: Checkout Repo 🛎
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go 🐹
uses: actions/setup-go@v5
with:
go-version: 1.24.5
cache: true
cache-dependency-path: go.sum
- name: Log in to the Container registry 🗝
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser 🚀
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}