Run changelog generation stage on ubuntu-latest, nightly (#10349)

Fixes https://github.com/certbot/certbot/issues/10328

This PR:
1) Moves changelog generation to ubuntu-latest instead of deprecated
windows, and
2) Sets it to run nightly so we catch breakages before release day
3) Modifies `update_changelog.py` to also allow `.dev0` version numbers
and headings with `main` instead of the date in them, for testing.

I could have been more specific about only matching `main` or a date,
but that seemed honestly unnecessary.

Here is a manually triggered nightly test; the test branch just
[removes](https://github.com/certbot/certbot/compare/changelog-gen...nightly-changelog-gen?expand=1)
all the other tests for speed:
https://dev.azure.com/certbot/certbot/_build/results?buildId=9250&view=results

You can download the created changelog artifact here:
https://dev.azure.com/certbot/certbot/_build/results?buildId=9250&view=artifacts&pathAsName=false&type=publishedArtifacts
This commit is contained in:
ohemorange 2025-06-20 09:38:34 -07:00 committed by GitHub
parent 035a6dcc39
commit bc0b54950a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -15,4 +15,5 @@ variables:
stages:
- template: templates/stages/test-and-package-stage.yml
- template: templates/stages/changelog-stage.yml
- template: templates/stages/nightly-deploy-stage.yml

View file

@ -3,13 +3,13 @@ stages:
jobs:
- job: prepare
pool:
vmImage: windows-2019
vmImage: ubuntu-latest
steps:
# If we change the output filename from `release_notes.md`, it should also be changed in tools/create_github_release.py
- bash: |
set -e
CERTBOT_VERSION="$(cd certbot/src && python -c "import certbot; print(certbot.__version__)" && cd ~-)"
"${BUILD_REPOSITORY_LOCALPATH}\tools\extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md"
"${BUILD_REPOSITORY_LOCALPATH}/tools/extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md"
displayName: Prepare changelog
- task: PublishPipelineArtifact@1
inputs:

View file

@ -12,8 +12,10 @@ NEW_SECTION_PATTERN = re.compile(r'^##\s*[\d.]+\s*-\s*[\d-]+$')
def main():
version = sys.argv[1]
if version.endswith('.dev0'):
version = version[:-5]
section_pattern = re.compile(r'^##\s*{0}\s*-\s*[\d-]+$'
section_pattern = re.compile(r'^##\s*{0}\s*-\s*.*$'
.format(version.replace('.', '\\.')))
with open(os.path.join(CERTBOT_ROOT, 'certbot', 'CHANGELOG.md')) as file_h: