-
Notifications
You must be signed in to change notification settings - Fork 156
113 lines (102 loc) · 3.37 KB
/
release.yaml
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
100
101
102
103
104
105
106
107
108
109
110
111
name: Release
on:
## FIXME: replace with on_merge
workflow_dispatch:
inputs:
release_tag:
description: 'Image tag in the format x.x.x(-rcx)'
required: true
type: string
env:
RELEASE_TAG: ${{ inputs.release_tag }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
create_tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
## FIXME: change to master
ref: ci-release
- run: |
git config --global user.name 'Kasten Production'
git config --global user.email '[email protected]'
git tag -a "${RELEASE_TAG}" -m "Release version"
git push origin "${RELEASE_TAG}"
release_packages:
runs-on: ubuntu-latest
needs: create_tag
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ inputs.release_tag }}
- name: build helm charts
run: |
export PACKAGE_FOLDER=helm_package
export HELM_RELEASE_REPO_URL=https://github.com/kanisterio/kanister/releases/download/${RELEASE_TAG}
export HELM_RELEASE_REPO_INDEX=https://charts.kanister.io/
make package_helm VERSION=${RELEASE_TAG}
- name: gorelease
run: |
export GITHUB_TOKEN="${GH_TOKEN}"
docker login https://ghcr.io -u kanisterio -p ${GHCR_TOKEN}
make gorelease
## Upload to use in docs publishing
- uses: actions/upload-artifact@v4
with:
name: helm-index
path: helm_package/index.yaml
release_docs_and_charts:
runs-on: ubuntu-latest
needs: release_packages
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ inputs.release_tag }}
- uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: pnpm install
- name: Build with VitePress
run: pnpm docs:build
- name: download helm helm
uses: actions/download-artifact@v4
with:
name: helm-index
path: docs/.vitepress/dist/helm_charts/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
publish_docs_and_charts:
needs: release_docs_and_charts
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
# release_example_docker_images:
# needs: release_packages
# steps:
# - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
# with:
# ref: ${{ inputs.release_tag }}
# - run: ./build/build_example_images.sh