mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fix PR labeling and generate nightly build notes from them. (#4077)
This configures the nightly build to generate release notes and provides a template for organizing them. The organization is done through labeling of PRs and categorizing them based on those labels. I've tried to provide a rough categorization that seems reasonable for folks. While doing this I looked at our PR labeling and found a few bugs that were preventing many labels form being attached. I've fixed those and significantly expanded the coverage of file-based labeling. I've also added code to do author-based labeling for automated PRs so those can be separated out from human PRs.
This commit is contained in:
@@ -26,20 +26,48 @@ jobs:
|
||||
documentation:
|
||||
- '*.md'
|
||||
- 'docs/**'
|
||||
- 'examples/**'
|
||||
- 'third_party/examples/**'
|
||||
|
||||
explorer:
|
||||
- 'explorer/**'
|
||||
- 'installers/**'
|
||||
|
||||
infrastructure:
|
||||
- 'BUILD'
|
||||
- 'WORKSPACE'
|
||||
- '*.bzl'
|
||||
- '*.cfg'
|
||||
- '*.toml'
|
||||
- '.*'
|
||||
- '.*/**'
|
||||
- 'BUILD'
|
||||
- 'MODULE.*'
|
||||
- 'WORKSPACE'
|
||||
- 'bazel/**'
|
||||
- 'github_tools/**'
|
||||
- 'proposal/scripts/**'
|
||||
- 'scripts/**'
|
||||
|
||||
# Here we only want the `proposal` label when a *new* file is added
|
||||
# directly in this directory. We use `added` and a single level glob
|
||||
# to achieve that.
|
||||
proposal:
|
||||
- added: 'proposals/*'
|
||||
|
||||
# We include common, shared code into the toolchain label for
|
||||
# convenience. Essentially, this is everything we intend to ship as
|
||||
# part of the reference implementation of the language.
|
||||
toolchain:
|
||||
- 'common/**'
|
||||
- 'core/**'
|
||||
- 'language_server/**'
|
||||
- 'testing/**'
|
||||
- 'toolchain/**'
|
||||
|
||||
utilities:
|
||||
- 'utils/**'
|
||||
|
||||
- id: documentation
|
||||
if: steps.filter.outputs.docs == 'true'
|
||||
if: steps.filter.outputs.documentation == 'true'
|
||||
run: |
|
||||
gh pr edit "${PR}" --add-label "documentation"
|
||||
env:
|
||||
@@ -55,13 +83,21 @@ jobs:
|
||||
PR: ${{ github.event.pull_request.html_url }}
|
||||
|
||||
- id: infrastructure
|
||||
if: steps.filter.outputs.docs == 'true'
|
||||
if: steps.filter.outputs.infrastructure == 'true'
|
||||
run: |
|
||||
gh pr edit "${PR}" --add-label "infrastructure"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.html_url }}
|
||||
|
||||
- id: proposal
|
||||
if: steps.filter.outputs.proposal == 'true'
|
||||
run: |
|
||||
gh pr edit "${PR}" --add-label "proposal"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.html_url }}
|
||||
|
||||
- id: toolchain
|
||||
if: steps.filter.outputs.toolchain == 'true'
|
||||
run: |
|
||||
@@ -69,3 +105,23 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.html_url }}
|
||||
|
||||
- id: utilities
|
||||
if: steps.filter.outputs.utilities == 'true'
|
||||
run: |
|
||||
gh pr edit "${PR}" --add-label "utilities"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.html_url }}
|
||||
|
||||
# Note that this is not a path-based label, but an *author* based label,
|
||||
# and it applies orthogonally to the others.
|
||||
- id: automated
|
||||
if:
|
||||
contains(fromJSON('["CarbonInfraBot", "dependabot"]'),
|
||||
github.event.pull_request.user.login)
|
||||
run: |
|
||||
gh pr edit "${PR}" --add-label "automated"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.html_url }}
|
||||
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
run: |
|
||||
gh release create \
|
||||
--title "Nightly build ${{ env.nightly_date }}" \
|
||||
--notes 'A nightly development build of Carbon.' \
|
||||
--generate-notes \
|
||||
--prerelease \
|
||||
v${{ env.release_version }} \
|
||||
"bazel-bin/toolchain/install/carbon_toolchain-${{ env.release_version }}.tar.gz"
|
||||
|
||||
Reference in New Issue
Block a user