-
Notifications
You must be signed in to change notification settings - Fork 25
88 lines (78 loc) · 3.28 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
name: Release chart package
on:
push:
tags:
- 'v*'
defaults:
run:
shell: bash
jobs:
helm-package:
runs-on: ubuntu-latest
env:
HELM_REPO_URL: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
HELM_REPO_USERNAME: ucentral
steps:
- name: Checkout uCentral assembly chart repo
uses: actions/checkout@v4
with:
path: wlan-cloud-ucentral-deploy
repository: Telecominfraproject/wlan-cloud-ucentral-deploy
# - name: Run pre-checks
# working-directory: wlan-cloud-ucentral-deploy/chart
# run: |
# pip3 install yq -q
# export CHART_VERSION=$(cat Chart.yaml | yq .version -r)
# export GIT_TAG=$(echo ${GITHUB_REF} | sed -e 's/refs\/tags\/[v]//' | tr '/' '-')
# if [ "$CHART_VERSION" != "$GIT_TAG" ]; then
# echo "Chart version in Chart.yaml ($CHART_VERSION) is different from Git tag ($GIT_TAG)";
# exit 1
# fi
#
# if [ "$(cat Chart.yaml | yq '.dependencies[].repository' -r | grep -E 'ref=(main|master)' | wc -l)" != "0" ]; then
# echo "Some of the dependencies does not have a fixed version set. List of affected dependencies:";
# cat Chart.yaml | yq '.dependencies[].repository' -r | grep -E 'ref=(main|master)';
# exit 1
# fi
- name: Build package
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
helm plugin install https://github.com/aslafy-z/helm-git --version 0.16.0
#helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm dependency update
mkdir dist
helm package . -d dist
- name: Login into Helm repo
run: helm repo add remote-repo ${{ env.HELM_REPO_URL }} --username ${{ env.HELM_REPO_USERNAME }} --password ${{ secrets.HELM_REPO_PASSWORD }}
- name: Push Helm package into Helm repo
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
pip3 install yq -q
export CHART_NAME=$(cat Chart.yaml | yq .name -r)
export CHART_VERSION=$(cat Chart.yaml | yq .version -r)
helm plugin install https://github.com/belitre/helm-push-artifactory-plugin --version v1.0.2
helm push-artifactory dist/$CHART_NAME-$CHART_VERSION.tgz remote-repo
- name: Generate GitHub release body
working-directory: wlan-cloud-ucentral-deploy/chart
run: |
pip3 install yq -q
echo "Versions of packages in this release:" > release.txt
echo >> release.txt
cat Chart.yaml | yq -r '.dependencies[] | "\(.name) - \(.repository) v\(.version)"' >> release.txt
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
body_path: wlan-cloud-ucentral-deploy/chart/release.txt
files: wlan-cloud-ucentral-deploy/chart/dist/*
trigger-testing:
runs-on: ubuntu-latest
needs: helm-package
steps:
- name: Trigger testing of release
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.WLAN_TESTING_PAT }}
repository: Telecominfraproject/wlan-testing
event-type: new-ap-release
client-payload: '{"ref": "${GITHUB_REF#refs/tags/}", "sha": "${{ github.sha }}"}'