Azure / Azure/azure-functions-dotnet-worker

Engineering: MSBuild release & version targets

Open
#1,738 0 comments 0 reactions 1 assignee Claimed by @jviau View on GitHub
area: engineering team-issue
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

Part of #1655

Initial prototype target files can be found here: https://github.com/jviau/dotnet-worker-layout/tree/main/eng/targets

We will introduce custom MSBuild targets which handle the following:

Handles targets for setting:

1. Common package/nuget settings
2. CI values
3. Versioning

## Versioning

We will adopt the following version schema: `{VersionPrefix}(-{VersionSuffix})?`, where `VersionSuffix` breaks down as: `Preview.N.BuildReason.BuildNumber.BuildRevision`

- `Preview` -> the optional preview tag we use. Typically only even `preview`, but may take on other values if we deem it necessary. This is optional and set in the csproj.
- `N` -> the preview number. Starts at `1`. Increments with each preview. This allows us the release successive previews without modifying `VersionPrefix`
- `BuildReasion` -> `dev`, `pr`, or `ci`. Dropped for release builds.
- `dev` -> always used during local builds
- `pr` -> always used for PR builds
- `ci` -> always used for non-release CI builds
- `BuildNumber` -> the date of the build in `yyMMdd` format. Dropped for release builds.
- `BuildRevision` -> the Azure pipelines build revision, an incrementing number to avoid build number conflicts from the same day. Always `0` for dev builds. Dropped for release builds.

## Release builds

Release build versions are triggered by building from a tag. The format must match `v.*`, or `{ext}-v.*`, where {ext} is an approved extension section being released. When a CI build is triggered from a tag, the additional version suffix from above is dropped (BuildReason.BuildNumber.BuildRevision).

examples:

- Local build: (preview) `1.0.0-preview.1.dev.230712.0`, (non-preview) `1.0.0-dev.230712.0`
- PR build: (preview) `1.0.0-preview.1.pr.230712.1`, (non-preview) `1.0.0-pr.230712.1`
- CI build: (preview) `1.0.0-preview.1.ci.230712.1`, (non-preview) `1.0.0-ci.230712.1`
- Release build: (preview) `1.0.0-preview.1`, (non-preview) `1.0.0`

## Package contents

All packages will now have their own `readme.md` and `release_notes.md`. Both of which will be pulled into the nuget package.

### README

The per-package readme.md is copied into the nuget package. The contents of this readme should include:

1. Brief overview of the package
1. Commonly used types, if applicable
1. A getting started section, if applicable

### Release Notes

The per-package release_notes.md contents will be copied into the package. They will also be prefixed with `See $(RepositoryUrl)/releases/tag/$(ReleaseTag)`, giving a link back to our Github release for further details.

The per-package release notes should cover only the changes made to this package in this release, being reset after every release.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.