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

Add links to core and contrib to Github releases on releases from this repository #498

Closed
mx-psi opened this issue Mar 5, 2024 · 33 comments · Fixed by #504 or #529
Closed

Add links to core and contrib to Github releases on releases from this repository #498

mx-psi opened this issue Mar 5, 2024 · 33 comments · Fixed by #504 or #529
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers priority:p3

Comments

@mx-psi
Copy link
Member

mx-psi commented Mar 5, 2024

By default, the Github release only includes the changelog from this repository, but most users would care more about the changelog on core and contrib.

I manually edited the release for v0.96.0 to include the core and contrib changelogs (see https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.96.0) but we could make this automatic via goreleaser using https://goreleaser.com/customization/release/#custom-release-notes.

@mx-psi mx-psi added enhancement New feature or request good first issue Good for newcomers priority:p3 labels Mar 5, 2024
@Enzujp
Copy link
Contributor

Enzujp commented Mar 11, 2024

Hello @mx-psi , @jpkrohling if this is still unattended, I'd love to work on it!

@mx-psi
Copy link
Member Author

mx-psi commented Mar 11, 2024

@Enzujp assigned to you!

@Enzujp
Copy link
Contributor

Enzujp commented Mar 11, 2024

@mx-psi Thank you, I'd get on it !

@Enzujp
Copy link
Contributor

Enzujp commented Mar 12, 2024

hello @mx-psi , while working on this, I discovered we can only automate using GoReleaser Pro, the feature that allows us link the change logs for core and contrib require the GoReleaser Pro and I don't have access to that. Is there perhaps another way to go about this ?

@TylerHelmuth
Copy link
Member

@Enzujp correct, we use goreleaser pro. Seems we've run into #497.

@Enzujp
Copy link
Contributor

Enzujp commented Mar 13, 2024

Aw shucks, I was looking forward to working on this @TylerHelmuth

@mx-psi
Copy link
Member Author

mx-psi commented Mar 13, 2024

@Enzujp We do have goreleaser Pro. An alternative is to use the CLI tool from Github, which has the gh release edit subcommand. Yet another alternative is to use a dedicated Github Action for this. Any of these options seems acceptable to me.

@Enzujp
Copy link
Contributor

Enzujp commented Mar 13, 2024

@mx-psi , Thank you very much I'd get on it.

@Enzujp
Copy link
Contributor

Enzujp commented Mar 20, 2024

Hello there @mx-psi, I finally got this to work as expected, it required a .goreleaser file in the root of the project. It does print the custom message and link to change logs from core and contrib; automatically updating the hyperlinks with each version released.
If this is acceptable, I'd like to create a pull request.

@TylerHelmuth
Copy link
Member

TylerHelmuth commented Mar 20, 2024

it required a .goreleaser file in the root of the project

I am curious to see this solution. How does it interact with the distro-specific .goreleaser files? Go ahead an open a PR.

@mx-psi
Copy link
Member Author

mx-psi commented Mar 25, 2024

Agreed, let's see a PR and discuss it there :)

@Enzujp
Copy link
Contributor

Enzujp commented Mar 25, 2024

Hello @mx-psi , welcome back! This already happened, would you like for me to tag you to it ?

@mx-psi
Copy link
Member Author

mx-psi commented Mar 25, 2024

Oh, looks like that should be #504, I had a look but missed it 😅 no need to tag me now!

djaglowski pushed a commit that referenced this issue Mar 26, 2024
* Automate release notes generation using goreleaser(closes #498)

* Create .gitgnore

* Rename .gitgnore to .gitignore
@TylerHelmuth
Copy link
Member

Adding the .goreleaser.yaml to the root of the directory did not work during the v0.97.0 release: https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.97.0

@TylerHelmuth TylerHelmuth reopened this Mar 26, 2024
@TylerHelmuth
Copy link
Member

I have manually updated the release notes to include the desired header.

@Enzujp
Copy link
Contributor

Enzujp commented Mar 27, 2024

I'll go through the goreleaser docs and find a better way to do it. I'd find a fix.

@TylerHelmuth
Copy link
Member

It might be easiest to use gh cli somehow. Also maybe try using release note templates.

@Enzujp
Copy link
Contributor

Enzujp commented Mar 27, 2024

@TylerHelmuth , I figured out what was missing! The repository specification is what's missing.

goreleaser_screenshot

@Enzujp
Copy link
Contributor

Enzujp commented Mar 27, 2024

Here's a sample of its usage and there's a release to show too : https://github.com/KenanBek/dbui/blob/main/.goreleaser.yml

@TylerHelmuth
Copy link
Member

I am still concerned that the jobs specify a workdir that is different than root. I noticed after the v0.97.0 release that I had missed that your example repo does not do that: https://github.com/Enzujp/sample-releases/blob/ddcbd7645567cf99ed6b818f3c040c709ca775dc/.github/workflows/goreleaser.yaml#L36-L43

@Enzujp
Copy link
Contributor

Enzujp commented Mar 27, 2024

I'll make adjustments to that, and test the code to be sure it works as it should this time.

@Enzujp
Copy link
Contributor

Enzujp commented Apr 12, 2024

Hello @mx-psi , @TylerHelmuth after about a week of battling and reading most of the goreleaser docs, here's what I've found. Having the .goreleaser file in the root directory doesn't work for the header release. They make mention of goreleaser release --release-notes command but it didn't work for templated text and there was no mention of how to use it for templated text so I experimented and searched and found this command goreleaser release --release-header-tmpl=file. It allows use of a markdown file, and here's a test of it, please check it out and let me know : https://github.com/Enzujp/sample-releases/actions/runs/8659835103/job/23746516462

@Enzujp
Copy link
Contributor

Enzujp commented Apr 15, 2024

Without the root as the working directory, this is the only other way to do it.

@TylerHelmuth
Copy link
Member

TylerHelmuth commented Apr 15, 2024

@Enzujp this looks promising. What happens if instead of a separate step you pass --release-header-tmpl=release.md as an argument like this:

- name: Run GoReleaser
  uses: goreleaser/goreleaser-action@v5
  with: 
    distribution: goreleaser
    version: latest
    workdir: distributions/${{ inputs.distribution }}
    args: release --clean --release-header-tmpl=release.md
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@Enzujp
Copy link
Contributor

Enzujp commented Apr 16, 2024

@TylerHelmuth
Copy link
Member

@Enzujp perfect! can you do one more test where 2 release jobs run with that argument (mimicking how Core, Contrib, and k8s all release at the same time in this repo)? I want to make sure they don't clash

@Enzujp
Copy link
Contributor

Enzujp commented Apr 16, 2024

@TylerHelmuth I'm a little confused as to how I'm to go about this, please explain a little further.

@TylerHelmuth
Copy link
Member

Can you update your release workflow with a second release job like

  goreleaser-2:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Set up Go
        uses: actions/setup-go@v4


      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v5
        with: 
          distribution: goreleaser
          version: latest
          workdir: distributions/otelcol-contrib
          args: release --clean --release-header-tmpl=../release.md
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@Enzujp
Copy link
Contributor

Enzujp commented Apr 16, 2024

@TylerHelmuth
Copy link
Member

Awesome, let's implement this option

@Enzujp
Copy link
Contributor

Enzujp commented Apr 16, 2024

@TylerHelmuth Got it. I only need include this in the release section right? Like this

- uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
       
 with:
          distribution: goreleaser-pro
          version: latest
          workdir: distributions/${{ inputs.distribution }}
          args: continue --merge --timeout 2h --release-header-tmpl=../release.md
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COSIGN_YES: true
          GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

@TylerHelmuth
Copy link
Member

TylerHelmuth commented Apr 16, 2024

Correct, and add the template file. It should live in .github and be named something like release-template.yaml

@Enzujp
Copy link
Contributor

Enzujp commented Apr 16, 2024

@TylerHelmuth , release-template.md it has to be a markdown file. I'll do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers priority:p3
Projects
None yet
3 participants