Skip to content

Commit a423ca4

Browse files
test: test ci
1 parent 08c1086 commit a423ca4

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/release-test.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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: v2.9.0
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/zfs-localpv
45+
helm pull "$CHART_REF" \
46+
--version "$TAG" \
47+
--destination charts-staged
48+
49+
tar -xzf charts-staged/zfs-localpv-"$TAG".tgz -C charts-final
50+
51+
mv charts-final/zfs-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: Update the registry and the repository
58+
run: |
59+
nix-shell --pure --run "./scripts/update-reg-repo.sh --registry docker.io/ --repository ${{ env.IMAGE_ORG }}/zfs-driver" ./shell.nix
60+
61+
- name: Publish chart via OCI
62+
uses: appany/[email protected]
63+
with:
64+
name: zfs-localpv
65+
repository: ${{ github.repository_owner }}/charts
66+
tag: ${{ env.VERSION }}
67+
path: ./deploy/helm/charts
68+
registry: ghcr.io
69+
registry_username: ${{ github.actor }}
70+
registry_password: ${{ secrets.GITHUB_TOKEN }}
71+
update_dependencies: 'false'

0 commit comments

Comments
 (0)