git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] githubci: add a workflow for creating GitHub release notes

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 26, 2021, 13:59 UTC
Message-ID
<nycvar.QRO.7.76.6.2111261455590.63@tvgsbejvaqbjf.bet>
In-Reply-To
<AM0PR04MB60196EFE984652ECCBD591A8A5629@AM0PR04MB6019.eurprd04.prod.outlook.com>
Hi,
On Thu, 25 Nov 2021, Matthias Aßhauer wrote:
Show 88 quoted lines
> On Thu, 25 Nov 2021, Mahdi Hosseinzadeh via GitGitGadget wrote:
>
> > diff --git a/.github/workflows/create-release.yml
> > b/.github/workflows/create-release.yml
> > new file mode 100644
> > index 00000000000..711ba105e42
> > --- /dev/null
> > +++ b/.github/workflows/create-release.yml
> > @@ -0,0 +1,40 @@
> > +name: Create GH release
> > +
> > +# Create a GitHub release for each new tag.
> > +# The release notes are taken from the release notes file
> > +# modified in that commit located in Documentation/RelNotes directory.
> > +
> > +on:
> > +  push:
> > +    tags:
> > +      - v[0-9]+.*
> > [...]
>
> All in all I think this is too convoluted for what it's trying to
> achieve. I think we should be able to achieve the same result with
> something like this:
>
>  .github/workflows/create-release.yml | 37 ++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 .github/workflows/create-release.yml
>
> diff --git a/.github/workflows/create-release.yml
> b/.github/workflows/create-release.yml
> new file mode 100644
> index 0000000000..5b9fdf0372
> --- /dev/null
> +++ b/.github/workflows/create-release.yml
> @@ -0,0 +1,37 @@
> +name: Create GH release
> +
> +# Create a GitHub release for each new tag.
> +# The release notes are taken from the release notes file
> +# modified in that commit located in Documentation/RelNotes directory.
> +
> +on:
> +  push:
> +    tags:
> +      - v[0-9]+.[0-9]+.[0-9]+
> +
> +permissions:
> +  contents: write
> +
> +jobs:
> +  create-gh-release:
> +    name: Create a new release or update an existing release in the GitHub
> repository
> +    runs-on: ubuntu-latest
> +    steps:
> +      - name: Checkout the repository
> +        uses: actions/checkout@v2
> +        with:
> +          fetch-depth: 1
> +      - name: Get version number
> +        shell: bash
> +        run: |
> +          echo GIT_VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV
> +      - name: Create the release
> +        uses: actions/create-release@v1
> +        env:
> +          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
> +        with:
> +          tag_name: ${{ github.ref_name }}
> +          release_name: ${{ github.ref_name }}
> +          body_path: Documentation/RelNotes/${{ env.GIT_VERSION }}.txt
> +          draft: false
> +          prerelease: false
> --
> 2.25.1
>
> An example of the result this reduced action produces can be found at [4]
> (release notes for v2.34.1, but the tagged commit isn't v2.34.1).
>
> Best regards
>
> Matthias
>
> [1] https://github.com/git/git/pull/1146
> [2] https://github.com/git/git/pull/1146#discussion_r756854259
> [3] https://github.com/git/git/pull/1146#discussion_r756845042
> [4] https://github.com/rimrul/git/releases/tag/v2.34.1

One thing I had not thought of earlier: do we really want to do this in every fork of git/git? I know for a fact that microsoft/git has a very different workflow upon pushing a tag.

So maybe we need something like this, too:
   create-gh-release:
+    if: github.repository == 'git/git'
     name: Create a new release or update an existing release in the GitHub repository

Ciao, Dscho

Previous: Matthias AßhauerNext: Matthias Aßhauer
Message 3 of 11 in “githubci: add a workflow for creating GitHub release notes”
  1. githubci: add a workflow for creating GitHub release notesMahdi Hosseinzadeh via GitGitGadget, Nov 25, 2021
  2. Matthias AßhauerNov 25, 2021
  3. Johannes SchindelinNov 26, 2021
  4. Matthias AßhauerNov 26, 2021
  5. Ævar Arnfjörð BjarmasonNov 29, 2021
  6. Johannes SchindelinNov 30, 2021
  7. Junio C HamanoDec 2, 2021
  8. Fabian StelzerDec 3, 2021
  9. Junio C HamanoDec 5, 2021
  10. Fabian StelzerDec 5, 2021
  11. Junio C HamanoDec 7, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.