Skip to content

Commit bc5cdbb

Browse files
authored
Merge pull request #29 from bUnit-dev/release/v1.25
Release of new minor version v1.25
2 parents 86ca2db + c0f8e88 commit bc5cdbb

File tree

5 files changed

+147
-66
lines changed

5 files changed

+147
-66
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: release-preview
2+
concurrency: 'release-preview'
3+
4+
on:
5+
workflow_run:
6+
branches: [ main ]
7+
workflows: [ 'verification' ]
8+
types: [ completed ]
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
release-preview:
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- name: 🛒 Checkout repository
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: ⚙️ Setup GIT versioning
24+
uses: dotnet/[email protected]
25+
26+
- name: ⚙️ Setup dotnet 5.0.x
27+
uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: '5.0.x'
30+
31+
- name: 🛠️ Building library in release mode
32+
run: dotnet pack src/ -c release -p:ContinuousIntegrationBuild=true
33+
34+
- name: 🛠️ Upload library to GitHub Package Repository
35+
run: echo "TODO"

.github/workflows/verification.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: verification
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
verify:
17+
name: 👌 Verify library
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: 🛒 Checkout repository
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
- name: ⚙️ Setup GIT versioning
27+
uses: dotnet/[email protected]
28+
with:
29+
setAllVars: true
30+
31+
- name: 🛠️ Building library in release mode
32+
run: dotnet build src

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
Live streaming on twitch change!
11+
1012
## [1.24.2] - 2021-04-25
1113

1214
Testing 3 . 2 . 1

README.md

Lines changed: 77 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,77 @@
1-
# workflows
2-
3-
Goal:
4-
5-
1. Follow github flow, e.g. PRs into mainline branch.
6-
2. Release of mainline
7-
3. Keep a change log, whose version numbers are automatically updated when a release is pushed
8-
4. Automatically create github releases, add tags to repo
9-
5. Automatically push nightly builds on push to mainline to GPR
10-
6. Allow for live documentation to be updated independently of releases
11-
7. Allow for docs to be updated with a release.
12-
8. Release workflows should be idempotent, be re-runable in case of errors
13-
14-
## common verification steps in PR / build on mainline
15-
1. build
16-
2. test
17-
3. verify template
18-
4. build docs
19-
5. build nuget packages
20-
21-
## Changes to code or documentation for next release:
22-
23-
1. Build of mainline
24-
2. Create PR, include update to changelog.md
25-
26-
## On merge to mail
27-
28-
1. Run code analyzers
29-
2. build nuget packages
30-
3. push nightly nuget packages to github package repository
31-
32-
## Create a release:
33-
34-
1. Trigger prepare-release workflow (input: versionIncrement, releaseImmediately):
35-
2. nbgv prepare-release --versionIncrement versionIncrement
36-
3. $version = nbgv get-version
37-
4. git push main
38-
5. git checkout release/($version)
39-
6. push release branch
40-
41-
## Release
42-
43-
1. build
44-
2. test
45-
3. verify template
46-
4. build docs
47-
5. build nuget packages
48-
6. update changelog.md with new version ($version) using keep-a-changelog-new-release
49-
7. Create version tag
50-
8. get version
51-
9. read changelog from https://github.com/mindsers/changelog-reader-action
52-
10. create github release with tag, title, and description
53-
11. Build nuget packages
54-
12. push nuget packages
55-
13. merge release branch with origin:mainline
56-
14. merge mainline to docs_live
57-
15. merge release branch with origin:docs_live
58-
16. delete release branch
59-
60-
## Updates to live docs
61-
62-
1. On push (merge of PR or direct push) to docs_live branch
63-
1. build docs and push to GH Pages
64-
2. merge with FF back to main
65-
3. if merge fails, create PR from docs_live to mainline
1+
# Workflows
2+
3+
The workflows have the goal of automating as much as possible, while keeping workflows flexible to handle odd cases when needed.
4+
5+
**NOTE:** whenever I write mainline below, I am referring to whatever is the default branch in a GitHub repository, e.g. `main`.
6+
7+
**The goals are:**
8+
9+
1. Follow GitHub flow, e.g. PRs into mainline branch.
10+
2. Mainline has latest preview/nightly code in unreleased form, and new preview releases is automatically pushed to GitHub Package Repository when source code changes in mainline.
11+
3. `stable` branch contains latest released code to NuGet.org.
12+
4. Use "[Keep a change log](https://keepachangelog.com/en/1.0.0/), where mainline has new items in "Unreleased" section, that are automatically moved to a "released versioned" section when released.
13+
5. Use "[Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning)" to correctly stamp versions, repository references, and commit references in .NET assemblies of both releases and prereleases.
14+
7. Automatically create GitHub releases and add tags on new release.
15+
8. Allow for live documentation to be updated independently of releases from stable.
16+
9. Allow for changes to docs to be updated with a release.
17+
10. Release workflows should be idempotent, be re-runable in case of errors.
18+
19+
The workflow examples are located in the usual place in this repository under `.github/workflows`, and are built with the settings defined in the [`version.json`](https://github.com/bUnit-dev/workflows/blob/main/version.json) in mind.
20+
21+
The following sections will list what should happen in the different scenarios involved.
22+
23+
## Changes to code or documentation for next release stored in mainline:
24+
25+
1. Locally, make changes from mainline branch. remember to update CHANGELOG.md.
26+
2. Push to mainline or create a PR targeting mainline, if not authorized to push directly.
27+
28+
## On push/pull request merged on mainline
29+
30+
1. Automatically trigger `verification` workflow.
31+
2. Automatically trigger `release-preview` workflow if `verification` workflow successed.
32+
33+
## On pull request (created, updated) to mainline
34+
35+
1. Automatically trigger `verification` workflow.
36+
37+
## Prepare a new release:
38+
39+
Manually trigger `prepare-release` workflow, specifying if it is a `minor` or `major` release. This does the following:
40+
41+
1. Check that release contains changes, if not, abort. This is verified by looking at the "Unreleased" section in the CHANGELOG.md.
42+
2. Increment version.json on mainline, e.g. 1.1-preview to 1.2-preview. Push mainline branch to origin.
43+
3. Create release branch and set version.json in that to non preview, e.g. 1.1. Push release branch to origin.
44+
4. Create pull request for release branch towards `stable`.
45+
46+
Creating the PR ensures `verification` workflow runs, and gives the option to make small adjustments before release if needed.
47+
48+
TODO:
49+
50+
- Make it possible to specify that the release PR should be accepted automatically for immidiate release.
51+
- Use some tooling like https://github.com/fsprojects/SyntacticVersioning/ or changelog analyser to automatically determine if the release is a minor or major release.
52+
53+
## Release:
54+
55+
Automatically trigger `release` workflow on release PR merged with stable, or if it is triggered manaully. This does the following:
56+
57+
1. Check that release contains changes, if not, abort. This is verified by looking at the "Unreleased" section in the CHANGELOG.md.
58+
2. Update changelog: move content from "unreleased" section to an "[x.y.c] yyyy-mm-dd" section
59+
3. Commit CHANGELOG.md to `stable` branch
60+
4. Building library in release mode
61+
5. Upload library to NuGet.org repository
62+
6. Push `stable` branch to origin
63+
7. Create GitHub release from commit with CHANGELOG.md changes on stable. The release is created with the title and content from the CHANGELOG related to the release.
64+
8. Merge `stable` with mainline and push to origin
65+
9. If merge between `stable` and mainline fails, then create a PR from `stable` to mainline instead.
66+
67+
The order of these steps are important as they make sure that GitVersioning correctly stamps the generated assemblies/nuget packages with the right version and github commit hash from when the changelog was updated.
68+
69+
## Updates to live docs on `stable`
70+
71+
If a library has a documentation site, the version of the docs should match the latest released version of the library. This, the source for the docs located on the `stable` branch is where the live documentation website is built from.
72+
73+
Since it is not uncommon that fixes and changes to the docs need to happen between releases, changes to the docs sources are the only changes allowed to be pushed to `stable` outside of normal release pull requests. When this happens, the following should happen:
74+
75+
1. Automatically trigger `docs-deploy` workflow, that builds and uploads docs to whatever hosting solution it uses, e.g. GH Pages.
76+
2. Merge `stable` with mainline branch, such that updated docs are visible in the mainline branch.
77+
3. If merge between `stable` and mainline fails, then create a PR from `stable` to mainline instead.

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.24",
3+
"version": "1.25",
44
"assemblyVersion": {
55
"precision": "revision"
66
},

0 commit comments

Comments
 (0)