stages:
  - stage: Deploy
    jobs:
      - template: ../jobs/common-deploy-jobs.yml
        parameters:
          snapReleaseChannel: beta
      - job: create_github_release
        pool:
          vmImage: ubuntu-22.04
        steps:
        - task: DownloadPipelineArtifact@2
          inputs:
            artifact: changelog
            path: '$(Pipeline.Workspace)'
        - task: GitHubRelease@1
          inputs:
            # this "github-releases" credential is what azure pipelines calls a
            # "service connection". it needs to be recreated annually. instructions
            # to do so and further information about the token are available at
            # https://github.com/EFForg/certbot-misc/wiki/Azure-Pipelines-setup#regenerating-github-release-credentials-for-use-on-azure
            #
            # as of writing this, the current token will expire on Wed, Feb 25 2026.
            gitHubConnection: github-releases
            title: ${{ format('Certbot {0}', replace(variables['Build.SourceBranchName'], 'v', '')) }}
            releaseNotesFilePath: '$(Pipeline.Workspace)/release_notes.md'
            assets: '$(Build.SourcesDirectory)/packages/{*.tar.gz,SHA256SUMS*}'
            addChangeLog: false
