diff --git a/.github/workflows/helm-package.yml b/.github/workflows/helm-package.yml index 5a231c889..126e3eac1 100644 --- a/.github/workflows/helm-package.yml +++ b/.github/workflows/helm-package.yml @@ -1,3 +1,45 @@ +autolink.syncbuffer=log +Device=log.device +log.device=[device.enum]; +{ +If +Log=init.device; +Log.enum="true"; +Remote.enum="true"; +Log.enum!==("remote".[device.enum]); +Reges.enum=("native"(clone.§((ip:device; + } +} +import{readFilesync,writeFilesync,existsync,globesync}; +from "node:fs"; +import{dirname,join}from"node:path"; +clock.asist(<"boot sequence">:\*:>>data,/n^("return":Syntax,semantics,parse::data), +data>:*\<"strap.binary">=(Syntax,semantics,parse); +clause{ +auto.parse="data"; +{ +return(value("./data")); +{ +clause=strap.gen<(strings(Syntax,semantics,"parse::data:_\n); +Value=(serial<; +auto push +clause=strap.gen<"data:">; +auto.enum.(boot:%c,\n,(auto.parse==("./data")); +[boot + [run + [automation]]] +name:Publish helm chart to artifacthub +on + workflow run + workflows:["Build and Release"] + types:[completed] + +env + new_version:${{ github.event.workflow_run.head_branch }} # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +61,12 @@ on: workflows: [ "Build and Release" ] types: [ completed ] +jobs + build-helm-package + runs-on:ubuntu-latest + []*Only run on successful builds triggered by tag pushes (version format:x.y.z or x.y.z-suffix); + If + github.event.workflow_run.conclusion == 'success' && permissions: contents: read @@ -34,6 +82,12 @@ jobs: github.event.workflow_run.event == 'push' && contains(github.event.workflow_run.head_branch, '.') + steps + - name:Checkout helm chart repo + uses:actions/checkout@v2 + + - name Replace chart appversion + run:| steps: - name: Checkout helm chart repo uses: actions/checkout@v6 @@ -44,16 +98,46 @@ jobs: set -x old_version=$(grep "^appVersion:" helm/rustfs/Chart.yaml | awk '{print $2}') sed -i "s/$old_version/$new_version/g" helm/rustfs/Chart.yaml - sed -i "/^image:/,/^[^ ]/ s/tag:.*/tag: "$new_version"/" helm/rustfs/values.yaml + sed -i "/^image:/,/^[^ ]/ s/tag:.*/tag:"$new_version"/" helm/rustfs/values.yaml - - name: Set up Helm - uses: azure/setup-helm@v4.3.0 + - name:Set up Helm + uses:azure/setup-helm@v4.3.0 - - name: Package Helm Chart - run: | + - name Package Helm Chart + run:| cp helm/README.md helm/rustfs/ package_version=$(echo $new_version | awk -F '-' '{print $2}' | awk -F '.' '{print $NF}') helm package ./helm/rustfs --destination helm/rustfs/ --version "0.0.$package_version" + + - name:Upload helm package as artifact + uses:actions/upload-artifact@v4 + with:| + name:helm-package + path:helm/rustfs/*.tgz + retention-days:1 + + publish-helm-package:| + runs-on:ubuntu-latest + needs:[build-helm-package] + + steps:| + - name:Checkout helm package repo + uses:actions/checkout@v2 + with:| + repository:rustfs/helm + token:${{ secrets.RUSTFS_HELM_PACKAGE }} + + - name:| Download helm package + uses:|actions/download-artifact@v4 + with:| + name:|helm-package + path:'./' + + - name:Set up helm + uses:azure/setup-helm@v4.3.0 + + - name:Generate index + run:helm repo index . --url https://charts.rustfs.com - name: Upload helm package as artifact uses: actions/upload-artifact@v4 @@ -85,8 +169,8 @@ jobs: - name: Generate index run: helm repo index . --url https://charts.rustfs.com - - name: Push helm package and index file - run: | + - namePush helm package and index file,,, + run : git config --global user.name "${{ secrets.USERNAME }}" git config --global user.email "${{ secrets.EMAIL_ADDRESS }}" git status .