From 31c49f1bcf0f76cc84319b0c3ceb3129f1004c0a Mon Sep 17 00:00:00 2001 From: Cole Arendt Date: Mon, 11 Jul 2022 13:51:36 -0400 Subject: [PATCH] add an adhoc chart-releaser that is triggered by the `/release-adhoc` issue comment This allows for releasing (in an adhoc fashion) from a branch. Unfortunately the behavior and how this will work for non-devel releases is not super well-defined. If chart-releaser adds support for filtering to only certain releases, that would be helpful to make this safer: https://github.com/helm/chart-releaser/issues/196 In particular, it is most concerning if chart A moves to `--devel` version on the `dev` branch, chart B moves to a newer version on `main`, and then CI runs. It would also be concerning if chart A or chart B move to a newer version on a branch and then publish a "non-devel" version from the branch. --- .github/workflows/chart-releaser-adhoc.yaml | 43 +++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/chart-releaser-adhoc.yaml diff --git a/.github/workflows/chart-releaser-adhoc.yaml b/.github/workflows/chart-releaser-adhoc.yaml new file mode 100644 index 00000000..4239135c --- /dev/null +++ b/.github/workflows/chart-releaser-adhoc.yaml @@ -0,0 +1,43 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +name: Release Charts (adhoc) + +on: + issue_comment: + types: [created] + +jobs: + release: + # from https://docs.github.com/en/graphql/reference/enums#commentauthorassociation + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/release-adhoc') }} + name: release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.6.3 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.2.0 + with: + charts_repo_url: https://helm.rstudio.com + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Run chart-releaser (other) + uses: helm/chart-releaser-action@v1.2.0 + with: + charts_dir: other-charts + charts_repo_url: https://helm.rstudio.com + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"