From a2713aa88ebc1f462f0d6092da25e1d1080285ea Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Mon, 24 Feb 2020 07:58:01 -0800 Subject: [PATCH] Add release script to upload charts (#39) Signed-off-by: Tamal Saha --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..272d02632 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + tags: + - '*.*' + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Clone charts repository + env: + GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} + run: | + cd $HOME + git clone https://1gtm:${GITHUB_TOKEN}@github.com/appscode/charts.git + cd charts + git config user.name "1gtm" + git config user.email "1gtm@appscode.com" + + - name: Package + run: | + echo "install helm 3" + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + echo "package chart" + helm package charts/stash + mv stash-*.tgz $HOME/charts/stable/stash + + - name: Create pull request + env: + GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} + run: | + export PR_BRANCH=${GITHUB_REPOSITORY}/${GITHUB_RUN_ID} + echo $PR_BRANCH + cd $HOME/charts + git checkout -b $PR_BRANCH + git commit -a -s -m "Push stash chart for $GITHUB_REF" + git push origin $PR_BRANCH -f + curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 + bin/hub pull-request -m "Push stash chart for $GITHUB_REF"