-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (68 loc) · 2.76 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
name: Release
on:
push:
branches:
- main
permissions: write-all
env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
jobs:
release:
name: Run Release Manager
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
# Pull all previous tags
fetch-depth: 0
fetch-tags: true
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Conventional Changelog Action
id: conventional-changelog
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-git-pull: true
skip-version-file: false
version-file: charts/sxt-node-chart/Chart.yaml
git-push: true
skip-on-empty: false # Always create commit
tag-prefix: "" #remove the 'v' prefix in tag
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.14.4
- name: Run chart-releaser
uses: helm/[email protected]
continue-on-error: true
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Continue chart-release
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
mkdir -p .cr-index .cr-release-packages
# download index.yaml or start as empty .. the index.yaml needs to be placed inside .cr-index/
curl --fail https://spaceandtimelabs.github.io/sxt-node-chart-repo/index.yaml -o .cr-index/index.yaml || touch .cr-index/index.yaml
# download all known release packages, the packages needs to be placed inside .cr-release-packages/
curl --fail -L -H "Authorization: token $CR_TOKEN" https://api.github.com/repos/spaceandtimelabs/sxt-node-chart-repo/releases | jq -r '.[].assets[] | (.name, .url)' | xargs -n 2 | while read name url; do
curl --fail -L -H "Authorization: token $CR_TOKEN" -H 'Accept: application/octet-stream' $url -o .cr-release-packages/$name
file .cr-release-packages/${i}.tgz |grep "gzip compressed data" || rm -f .cr-release-packages/${i}.tgz
done
# cr command.. will fail
cr index --owner "spaceandtimelabs" --git-repo sxt-node-chart-repo || cat .cr-index/index.yaml
git checkout -t origin/gh-pages
mv .cr-index/index.yaml index.yaml
git add index.yaml
git commit -m "update index.yaml"
git push origin HEAD