diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..dc734c1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,29 @@ +on: + release: + types: [created] + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 + goos: [linux, windows, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm64 + goos: windows + steps: + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.30 + with: + github_token: ${{ secrets.TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "https://dl.google.com/go/go1.18.5.linux-amd64.tar.gz" + project_path: "." + binary_name: "schema-generator" + extra_files: "./scripts/install.sh" \ No newline at end of file diff --git a/plugin.yaml b/plugin.yaml new file mode 100644 index 0000000..6b0cfd4 --- /dev/null +++ b/plugin.yaml @@ -0,0 +1,6 @@ +name: "schema-generator" +version: "0.1.0" +usage: "generate json schema for values yaml" +description: "generate json schema (standard version: https://json-schema.org/draft/2019-09/schema) for values yaml" +ignoreFlags: false +command: "$HELM_PLUGIN_DIR/bin/schema-generator" \ No newline at end of file diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..0b39e8e --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +/tmp-scripts \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..546dcb1 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +depsPath="$(dirname $BASH_SOURCE)"/tmp-scripts +mkdir -p "$depsPath" + +curl -J -s \ + -H 'Accept: application/vnd.github.v3.raw' \ + -o "$depsPath/colors.sh"\ + -L 'https://api.github.com/repos/alex60217101990/bash-tools/contents/colors.sh' + +curl -J -s \ + -H 'Accept: application/vnd.github.v3.raw' \ + -o "$depsPath/logger.sh"\ + -L 'https://api.github.com/repos/alex60217101990/bash-tools/contents/logger.sh' + +. "$depsPath"/logger.sh -c=true + +INFO "$(helm3 env | grep HELM_PLUGIN)" + +