-
Notifications
You must be signed in to change notification settings - Fork 763
99 lines (86 loc) · 3.12 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
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
98
99
name: Release Charts
on:
push:
branches:
- master
env:
tag_prefix: v
jobs:
test:
uses: "traefik/traefik-helm-chart/.github/workflows/test.yml@master"
release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global --add safe.directory /charts
- name: Copy LICENSE and README.md for packaging
run: |
cp ./README.md ./traefik/README.md
cp ./EXAMPLES.md ./traefik/EXAMPLES.md
cp ./LICENSE ./traefik/LICENSE
- name: Generate default static install
run: |
kustomize build traefik/crds > traefik.yaml
helm template traefik ./traefik -n traefik >> traefik.yaml
- name: Get chart verison
id: chart_version
run: |
echo "CHART_VERSION=$(cat traefik/Chart.yaml | awk -F"[ ',]+" '/version:/{print $2}')" >> $GITHUB_OUTPUT
- name: Check if tag exists
id: tag_exists
run: |
TAG_EXISTS=true
if ! [ $(git tag -l "${{ env.tag_prefix }}${{ steps.chart_version.outputs.CHART_VERSION }}") ]; then
TAG_EXISTS=false
fi
echo TAG_EXISTS=$TAG_EXISTS >> $GITHUB_OUTPUT
- name: Tag release
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.chart_version.outputs.CHART_VERSION }}
tag_prefix: ${{ env.tag_prefix }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
prerelease: ${{ contains(steps.chart_version.outputs.CHART_VERSION, '-') }}
artifacts: "traefik.yaml"
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
- name: Publish Helm chart
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.CHARTS_TOKEN }}
charts_dir: .
charts_url: https://traefik.github.io/charts
owner: traefik
repository: charts
branch: master
target_dir: traefik
index_dir: .
commit_username: traefiker
commit_email: 30906710+traefiker@users.noreply.github.com
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'
- name: Publish Helm chart to the ghcr.io registry
uses: appany/helm-oci-chart-releaser@v0.4.2
with:
name: traefik
repository: traefik/helm
tag: ${{ steps.chart_version.outputs.CHART_VERSION }}
path: ./traefik
registry: ghcr.io
registry_username: traefiker
registry_password: ${{ secrets.GHCR_TOKEN }}
if: steps.tag_exists.outputs.TAG_EXISTS == 'false'