Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interest in having a release via GHA? #72

Closed
jessebot opened this issue Jul 4, 2023 · 3 comments
Closed

interest in having a release via GHA? #72

jessebot opened this issue Jul 4, 2023 · 3 comments

Comments

@jessebot
Copy link
Contributor

jessebot commented Jul 4, 2023

Hoi and thanks for maintaining this helm chart! :)

I setup a demo at jessebot/mastodon-helm-chart on how to setup a release via github-pages using the helm/chart-releaser-action. I can submit a pull request with that if you'd like. In the demo I have on my fork of this repo, I'm also using the latest versions of the bitnami oci compliant helm charts, but I would remove that from a potential PR on this topic to keep it scoped properly.

The gist of the required changes would be:

  • create charts/mastodon directory
  • move templates/, values.yaml, dev-values.yaml, Chart.yaml, and Chart.lock into charts/mastodon
  • create a branch called gh-pages
  • under ⚙️ Settings > Actions > Workflow Permissions select "Read and write permissions"
Workflow permissions screenshot reads Choose the default permissions granted to the GITHUB_TOKEN when running workflows in this repository. You can specify more granular permissions in the workflow using YAML. Learn more. https://docs.github.com/actions/reference/authentication-in-a-workflow#modifying-the-permissions-for-the-github_token Option selected is: Workflows have read and write permissions in the repository for all scopes. - create a workflow file in `.github/workflows/release.yaml` something like this:
name: Release Chart
concurrency: chart_releaser

on:
  push:
    branches:
      - main
    paths-ignore:
      - '.github/**'
      - '**/README.md'
      - 'LICENSE'

jobs:
  release:
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Fetch history
        run: git fetch --prune --unshallow

      - name: Configure Git
        run: |
          git config user.name "$GITHUB_ACTOR"
          git config user.email "[email protected]"

      # See https://github.com/helm/chart-releaser-action/issues/6
      - name: Set up Helm
        uses: azure/[email protected]
        with:
          version: v3.11.1

      - name: Add dependency chart repos
        run: |
          helm dep update charts/mastodon

      - name: Run chart-releaser
        uses: helm/[email protected]
        env:
          CR_GENERATE_RELEASE_NOTES: true
          CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

This is not dissimilar to what we're doing over in the community lead nextcloud/helm repo. The only caveat is that you still have to remember to manually bump the helm chart version each time in any commits you merge.

This isn't urgent or required for me right now, but it would be nice to have more official releases :)

@jeremiahlee
Copy link
Contributor

See also: #54, #27

@jessebot
Copy link
Contributor Author

Thanks, @jeremiahlee ! I'll close this as a duplicate of that issue/PR you posted :)

@jessebot
Copy link
Contributor Author

jessebot commented Jul 21, 2023

fix how this is closed

@jessebot jessebot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants