1
0
mirror of https://github.com/certbot/certbot.git synced 2025-08-08 04:02:10 +03:00

Create a release pipeline on Azure for Windows installer (#7441)

This PR creates a pipeline triggered on tag push matching v0.* (eg. v0.40.0).

Once triggered, this pipeline will build the windows installer, and run integration tests on it, like for the pipeline run nightly.

I also add a simple script to extract from CHANGELOG.md file to extract the relevant part to put it in the body of the GitHub release. I believe it makes things nicer.

* Create release pipeline

* Relax condition on tags

* Put beta keyword

* Update job name

* Fix release pipeline
This commit is contained in:
Adrien Ferrand
2019-10-30 18:19:10 +01:00
committed by Brad Warren
parent 0f31d9b7ac
commit 2dbe47f3a7
7 changed files with 78 additions and 4 deletions

View File

@@ -15,5 +15,7 @@ schedules:
always: true always: true
jobs: jobs:
# Any addition here should be reflected in the release pipeline.
# It is advised to declare all jobs here as templates to improve maintainability.
- template: templates/tests-suite.yml - template: templates/tests-suite.yml
- template: templates/installer-tests.yml - template: templates/installer-tests.yml

View File

@@ -0,0 +1,13 @@
# Release pipeline to build and deploy Certbot for Windows for GitHub release tags
trigger:
tags:
include:
- v*
pr: none
jobs:
# Any addition here should be reflected in the advanced pipeline.
# It is advised to declare all jobs here as templates to improve maintainability.
- template: templates/tests-suite.yml
- template: templates/installer-tests.yml
- template: templates/changelog.yml

View File

@@ -0,0 +1,14 @@
jobs:
- job: changelog
pool:
vmImage: vs2017-win2016
steps:
- bash: |
CERTBOT_VERSION="$(python -c "import certbot; print(certbot.__version__)")"
"${BUILD_REPOSITORY_LOCALPATH}\tools\extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md"
displayName: Prepare changelog
- task: PublishPipelineArtifact@1
inputs:
path: $(Build.ArtifactStagingDirectory)
artifact: changelog
displayName: Publish changelog

View File

@@ -18,8 +18,9 @@ jobs:
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
inputs: inputs:
path: $(Build.ArtifactStagingDirectory) path: $(Build.ArtifactStagingDirectory)
artifact: WindowsInstaller artifact: windows-installer
- script: $(Build.ArtifactStagingDirectory)\certbot-installer-win32.exe /S displayName: Publish Windows installer
- script: $(Build.ArtifactStagingDirectory)\certbot-beta-installer-win32.exe /S
displayName: Install Certbot displayName: Install Certbot
- script: | - script: |
python -m venv venv python -m venv venv

41
tools/extract_changelog.py Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import re
CERTBOT_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
NEW_SECTION_PATTERN = re.compile(r'^##\s*[\d.]+\s*-\s*[\d-]+$')
def main():
version = sys.argv[1]
section_pattern = re.compile(r'^##\s*{0}\s*-\s*[\d-]+$'
.format(version.replace('.', '\\.')))
with open(os.path.join(CERTBOT_ROOT, 'CHANGELOG.md')) as file_h:
lines = file_h.read().splitlines()
changelog = []
i = 0
while i < len(lines):
if section_pattern.match(lines[i]):
i = i + 1
while i < len(lines):
if NEW_SECTION_PATTERN.match(lines[i]):
break
changelog.append(lines[i])
i = i + 1
i = i + 1
changelog = [entry for entry in changelog if entry]
print('\n'.join(changelog))
if __name__ == '__main__':
main()

View File

@@ -113,7 +113,7 @@ target=$INSTDIR\\run.bat
[Build] [Build]
directory=nsis directory=nsis
nsi_template=template.nsi nsi_template=template.nsi
installer_name=certbot-installer-{installer_suffix}.exe installer_name=certbot-beta-installer-{installer_suffix}.exe
[Python] [Python]
version={python_version} version={python_version}

View File

@@ -60,7 +60,10 @@ SetCompressor lzma
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
[% endblock modernui %] [% endblock modernui %]
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" ; CERTBOT CUSTOM BEGIN
Name "${PRODUCT_NAME} (beta) ${PRODUCT_VERSION}"
;Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
; CERTBOT CUSTOM END
OutFile "${INSTALLER_NAME}" OutFile "${INSTALLER_NAME}"
ShowInstDetails show ShowInstDetails show