Skip to content

Commit 4bb6f90

Browse files
test: test ci
Signed-off-by: Tiago Castro <[email protected]>
1 parent 407c6d4 commit 4bb6f90

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/release-test.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Release Images and Charts
2+
3+
on:
4+
release:
5+
types:
6+
- "created"
7+
push:
8+
branches:
9+
- helm-oci
10+
11+
jobs:
12+
release-images-and-chart:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- uses: cachix/install-nix-action@v22
19+
- name: Pre-populate nix-shell
20+
run: |
21+
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
22+
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
23+
nix-shell --pure --run "echo" ./shell.nix
24+
25+
- name: Set Image Org
26+
run: |
27+
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG }}
28+
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
29+
30+
- name: Log in to GHCR for Helm
31+
run: nix-shell --pure --run "echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin" ./shell.nix
32+
33+
- name: Pull OCI chart from GHCR
34+
env:
35+
IMAGE_ORG: ${{ env.IMAGE_ORG }}
36+
RAW_TAG: ${{ github.ref_name }}
37+
run: |
38+
TAG="${RAW_TAG#v}"
39+
echo "Using chart version: $TAG"
40+
41+
rm -rf deploy/helm/charts
42+
mkdir -p charts-staged charts-final deploy/helm/charts
43+
44+
CHART_REF=oci://ghcr.io/${IMAGE_ORG}/helm/lvm-localpv
45+
helm pull "$CHART_REF" \
46+
--version "$TAG" \
47+
--destination charts-staged
48+
49+
tar -xzf charts-staged/lvm-localpv-"$TAG".tgz -C charts-final
50+
51+
mv charts-final/lvm-localpv/* deploy/helm/charts
52+
53+
- name: Set Chart Version
54+
run: |
55+
echo "VERSION=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)" >> $GITHUB_ENV
56+
57+
- name: Login to Docker Hub
58+
uses: docker/login-action@v3
59+
with:
60+
username: ${{ secrets.DOCKERHUB_USERNAME }}
61+
password: ${{ secrets.DOCKERHUB_TOKEN }}
62+
63+
- name: Update the registry and the repository
64+
run: |
65+
nix-shell --pure --run "./scripts/update-reg-repo.sh --registry docker.io/ --repository ${{ env.IMAGE_ORG }}/lvm-driver" ./shell.nix
66+
67+
- name: Publish chart via helm-gh-pages
68+
uses: stefanprodan/helm-gh-pages@master
69+
with:
70+
token: ${{ secrets.GITHUB_TOKEN }}
71+
charts_dir: ./deploy/helm
72+
73+
- name: Publish chart via OCI
74+
uses: appany/[email protected]
75+
with:
76+
name: lvm-localpv
77+
repository: ${{ github.repository_owner }}/charts
78+
tag: ${{ env.VERSION }}
79+
path: ./deploy/helm
80+
registry: ghcr.io
81+
registry_username: ${{ github.actor }}
82+
registry_password: ${{ secrets.GITHUB_TOKEN }}
83+
update_dependencies: 'false'

0 commit comments

Comments
 (0)