diff --git a/.ci/release.sh b/.ci/release.sh index 0e08c71..50f4817 100755 --- a/.ci/release.sh +++ b/.ci/release.sh @@ -64,29 +64,25 @@ function release::update_chart_index() { } function release::git_setup() { - cat <<- EOF > $HOME/.netrc - machine github.com - login $GITHUB_ACTOR - password $GITHUB_TOKEN - machine api.github.com - login $GITHUB_ACTOR - password $GITHUB_TOKEN -EOF - chmod 600 $HOME/.netrc - - git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" - git config --global user.name "$GITHUB_ACTOR" + git config --global user.email "dev@pulsar.apache.org" + git config --global user.name "Apache Pulsar Team" } function release::publish_charts() { release::git_setup - git remote update - git fetch --all - git checkout gh-pages - cp --force ${CHARTS_INDEX}/index.yaml index.yaml - git add index.yaml + git clone https://${GITHUB_TOKEN}@github.com/apache/pulsar + cd pulsar + git checkout asf-site + mkdir -p content/charts + cp --force ${CHARTS_INDEX}/index.yaml content/charts/index.yaml + git add content/charts/index.yaml + ls content/charts git commit --message="Publish new charts to ${CHARTS_REPO}" --signoff - git push --set-upstream origin gh-pages + if [[ "x${PUBLISH_CHARTS}" == "xtrue" ]]; then + git push --set-upstream origin asf-site + else + git push --dry-run --set-upstream origin asf-site + fi } # install cr @@ -116,7 +112,4 @@ done release::upload_packages release::update_chart_index - -if [[ "x${PUBLISH_CHARTS}" == "xtrue" ]]; then - release::publish_charts -fi +release::publish_charts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2e730e..a388d7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + token: ${{ secrets.PULSARBOT_TOKEN }} - name: Install chart env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PULSARBOT_TOKEN }} PUBLISH_CHARTS: true run: | .ci/release.sh diff --git a/.github/workflows/verify_release.yml b/.github/workflows/verify_release.yml new file mode 100644 index 0000000..57720c4 --- /dev/null +++ b/.github/workflows/verify_release.yml @@ -0,0 +1,39 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Precommit - Verify releasing Pulsar Helm Chart +on: + pull_request: + branches: + - '*' + paths: + - 'charts/pulsar/**' +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install chart + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PUBLISH_CHARTS: false + run: | + .ci/release.sh diff --git a/charts/pulsar/Chart.yaml b/charts/pulsar/Chart.yaml index f2c535e..32d290b 100644 --- a/charts/pulsar/Chart.yaml +++ b/charts/pulsar/Chart.yaml @@ -21,7 +21,7 @@ apiVersion: v1 appVersion: "1.0" description: Apache Pulsar Helm chart for Kubernetes name: pulsar -version: 1.0.0 +version: 2.6.0 home: https://pulsar.apache.org sources: - https://github.com/apache/pulsar