Skip to content

Commit 3724e9c

Browse files
committed
Merge branch 'release/v2.11'
2 parents 3024e2c + d6abcef commit 3724e9c

File tree

14 files changed

+192
-77
lines changed

14 files changed

+192
-77
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
prepare-release:
1414
name: 🚚 Prepare new release
1515
runs-on: ubuntu-latest
16-
if: github.ref == 'refs/heads/main' && contains(fromJson('["major","minor"]'), github.event.inputs.versionIncrement)
16+
if: contains(fromJson('["major","minor"]'), github.event.inputs.versionIncrement)
1717
steps:
1818
- name: 🛒 Checkout repository
1919
uses: actions/checkout@v2
@@ -33,7 +33,6 @@ jobs:
3333
run: |
3434
echo "::error file=CHANGELOG.md::The unreleased section in the changelog is empty. Nothing to release."
3535
exit 1
36-
3736
- name: ⚙️ Import GPG key
3837
id: import_gpg
3938
uses: crazy-max/ghaction-import-gpg@v3

.github/workflows/release-preview.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,60 @@ concurrency: 'release-preview'
33

44
on:
55
workflow_run:
6-
branches: [ main ]
76
workflows: [ 'verification' ]
8-
types: [ completed ]
7+
types: [completed]
8+
branches: [main, v2]
99

1010
workflow_dispatch:
11+
inputs:
12+
nugetRelease:
13+
description: 'Release to NuGet? Set to "true" to release to NuGet.org as well as GPR.'
14+
required: true
15+
default: 'false'
1116

1217
jobs:
1318
release-preview:
14-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
19+
if: github.event_name == 'workflow_dispatch' || (github.ref == 'refs/heads/main' && ${{ github.event.workflow_run.conclusion == 'success' }}) || (github.ref == 'refs/heads/v2' && ${{ github.event.workflow_run.conclusion == 'success' }})
1520
runs-on: ubuntu-latest
1621
steps:
17-
22+
1823
- name: 🛒 Checkout repository
1924
uses: actions/checkout@v2
2025
with:
2126
fetch-depth: 0
2227

2328
- name: ⚙️ Setup GIT versioning
2429
uses: dotnet/nbgv@v0.4.0
25-
26-
- name: ⚙️ Setup dotnet 5.0.x
27-
uses: actions/setup-dotnet@v1
30+
31+
- name: ⚙️ Setup dotnet versions
32+
uses: actions/setup-dotnet@v3
33+
with:
34+
dotnet-version: |
35+
3.1.x
36+
5.0.x
37+
6.0.x
38+
7.0.x
39+
include-prerelease: true
40+
41+
- name: 🎨 Setup color
42+
run: |
43+
echo "DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION=1" >> $GITHUB_ENV
44+
echo "TERM=xterm" >> $GITHUB_ENV
45+
46+
- name: 🛠️ Update tokens in project files
47+
uses: cschleiden/replace-tokens@v1
2848
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-
49+
files: '["*.csproj", "**/*.csproj"]'
50+
51+
- name: 🛠️ Packing library in release mode
52+
run: |
53+
dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
54+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
55+
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
56+
3457
- name: 🛠️ Upload library to GitHub Package Repository
35-
run: echo "TODO"
58+
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bunit-dev/index.json --skip-duplicate --no-symbols
59+
60+
- name: 🛠️ Upload library to NuGet.org repository
61+
if: github.event.inputs.nugetRelease == 'true'
62+
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols

.github/workflows/release.yml

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,84 +8,98 @@ on:
88
types:
99
- closed
1010
paths-ignore:
11-
- 'docs/**'
11+
- 'docs/**'
1212

1313
workflow_dispatch:
14-
15-
jobs:
14+
15+
jobs:
1616
release:
1717
name: 🎁 Publish new release
1818
# Only run on manual dispatch or on merged 'release-' pull requests
19-
if: github.ref == 'refs/heads/stable' ||
19+
if: github.ref == 'refs/heads/stable' ||
2020
github.event.pull_request.merged == true && contains(github.head_ref, 'release/v') == true
2121
runs-on: ubuntu-latest
2222
steps:
23-
23+
2424
- name: 🛒 Checkout repository
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626
with:
2727
fetch-depth: 0
2828
token: ${{ secrets.BUNIT_BOT_TOKEN }}
29-
29+
3030
- name: 🛠️ Get Changelog Entry
3131
id: changelog_reader
3232
uses: mindsers/changelog-reader-action@v2
3333
with:
3434
version: Unreleased
3535
path: ./CHANGELOG.md
36-
36+
3737
- name: ☑ Check that release contains changes
3838
if: steps.changelog_reader.outputs.changes == ''
3939
run: |
4040
echo "::error file=CHANGELOG.md::The unreleased section in the changelog is empty. Nothing to release."
4141
exit 1
42-
42+
4343
- name: ⚙️ Import GPG key
4444
id: import_gpg
4545
uses: crazy-max/ghaction-import-gpg@v3
4646
with:
4747
gpg-private-key: ${{ secrets.BUNIT_BOT_GPG_PRIVATE_KEY }}
4848
passphrase: ${{ secrets.BUNIT_BOT_GPG_KEY_PASSPHRASE }}
49-
49+
5050
- name: ⚙️ Setup CI GIT
5151
run: |
5252
git config user.name "${{ steps.import_gpg.outputs.name }}"
5353
git config user.email ${{ steps.import_gpg.outputs.email }}
5454
git config --global user.signingkey ${{ steps.import_gpg.outputs.keyid }}
55-
git config --global commit.gpgsign true
56-
55+
git config --global commit.gpgsign true
56+
5757
- name: ⚙️ Setup GIT versioning
5858
uses: dotnet/nbgv@v0.4.0
5959
with:
60-
setAllVars: true
61-
62-
- name: ⚙️ Setup dotnet 5.0.x
63-
uses: actions/setup-dotnet@v1
60+
setAllVars: true
61+
62+
- name: ⚙️ Setup dotnet versions
63+
uses: actions/setup-dotnet@v3
6464
with:
65-
dotnet-version: '5.0.x'
65+
dotnet-version: |
66+
3.1.x
67+
5.0.x
68+
6.0.x
69+
7.0.x
70+
include-prerelease: true
6671

6772
- name: 🛠️ Update changelog
6873
uses: thomaseizinger/keep-a-changelog-new-release@1.2.1
6974
with:
7075
version: ${{ env.NBGV_SemVer2 }}
71-
76+
7277
- name: 🛠️ Update changelog compare URLs
7378
shell: bash
7479
run: |
7580
sed -i -E "s/compare\/([0-9]+\.[0-9]+\.[0-9]+)\.\.\.([0-9]+\.[0-9]+\.[0-9]+)/compare\/v\1...v\2/" CHANGELOG.md
7681
sed -i -E "s/compare\/([0-9]+\.[0-9]+\.[0-9]+)\.\.\.HEAD/compare\/v\1...HEAD/" CHANGELOG.md
77-
82+
7883
- name: 🛠️ Commit CHANGELOG.md to stable branch
7984
run: |
8085
git add CHANGELOG.md
8186
git commit -S -m "Updated CHANGELOG.md for ${{ env.NBGV_SimpleVersion }} release"
8287
echo "RELEASE_COMMIT_HASH=$(git rev-parse stable)" >> $GITHUB_ENV
8388
84-
- name: 🛠️ Building library in release mode
85-
run: dotnet pack src/ -c release -p:ContinuousIntegrationBuild=true
86-
89+
- name: 🛠️ Update tokens in project files
90+
uses: cschleiden/replace-tokens@v1
91+
with:
92+
files: '["*.csproj", "**/*.csproj"]'
93+
94+
- name: 🛠️ Packing library in release mode
95+
run: |
96+
dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
97+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
98+
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
99+
87100
- name: 🛠️ Upload library to NuGet.org repository
88-
run: echo "TODO"
101+
run: |
102+
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
89103
90104
- name: ⏩ Push stable branch
91105
run: git push origin stable
@@ -97,19 +111,19 @@ jobs:
97111
with:
98112
tag_name: v${{ env.NBGV_SemVer2 }}
99113
target_commitish: ${{ env.RELEASE_COMMIT_HASH }}
100-
name: Release ${{ env.NBGV_SemVer2 }}
114+
name: ${{ env.NBGV_SemVer2 }}
101115
body: ${{ steps.changelog_reader.outputs.changes }}
102116
draft: false
103117
prerelease: ${{ env.NBGV_PublicRelease == 'False' }}
104-
105-
- name: ⏩ Merge stable with main, push main
118+
119+
- name: ⏩ Merge stable with main, push to origin
106120
id: mergeMainline
107121
continue-on-error: true
108-
run: |
122+
run: |
109123
git checkout main
110124
git merge -S stable
111125
git push origin main
112-
126+
113127
- name: ⏭ Create pull request from stable to main when direct merge fails
114128
if: steps.mergeMainline.outcome == 'failure'
115129
uses: thomaseizinger/create-pull-request@1.0.0
@@ -122,5 +136,5 @@ jobs:
122136
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
123137
body: |
124138
Hi @${{ github.actor }}
125-
139+
126140
This PR was created because the [release workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed to automatically merge stable into main.

.github/workflows/verification.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,59 @@ name: verification
33
on:
44
push:
55
branches:
6-
- main
6+
- main
7+
- v2
78
paths:
8-
- 'src/**'
9+
- 'src/**'
910
- 'tests/**'
10-
11+
1112
pull_request:
1213
types:
1314
- opened
1415
- synchronize
15-
- reopened
16+
- reopened
17+
1618
workflow_dispatch:
1719

20+
concurrency:
21+
group: verification-${{ github.ref }}-1
22+
cancel-in-progress: true
23+
1824
jobs:
19-
verify:
20-
name: 👌 Verify library
21-
runs-on: ubuntu-latest
25+
verify-bunit:
26+
name: 👌 Verify bUnit
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, macos-latest, windows-latest]
31+
runs-on: ${{ matrix.os }}
2232

2333
steps:
2434
- name: 🛒 Checkout repository
2535
uses: actions/checkout@v2
2636
with:
2737
fetch-depth: 0
2838

39+
- name: ⚙️ Setup dotnet versions
40+
uses: actions/setup-dotnet@v3
41+
with:
42+
dotnet-version: |
43+
3.1.x
44+
5.0.x
45+
6.0.x
46+
7.0.x
47+
include-prerelease: true
48+
49+
- name: 🎨 Setup color
50+
if: matrix.os != 'windows-latest'
51+
run: |
52+
echo "DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION=1" >> $GITHUB_ENV
53+
echo "TERM=xterm" >> $GITHUB_ENV
54+
2955
- name: ⚙️ Setup GIT versioning
3056
uses: dotnet/nbgv@v0.4.0
3157
with:
3258
setAllVars: true
33-
34-
- name: 🛠️ Building library in release mode
35-
run: dotnet build src
59+
60+
- name: 🛠️ Building library in release mode
61+
run: dotnet build

CHANGELOG.md

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

1212
Test
1313

14+
## [2.10.0] - 2021-05-03
15+
16+
Test
17+
1418
## [2.9.2] - 2021-04-30
1519

1620
asdfsadfasdf

src/Program.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/ProjectA/Program.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System;
2+
3+
namespace ProjectA
4+
{
5+
class Program
6+
{
7+
}
8+
}

src/ProjectA/ProjectA.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<AssemblyName>ProjectA</AssemblyName>
6+
</PropertyGroup>
7+
8+
</Project>

src/ProjectB/Program.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System;
2+
3+
namespace ProjectB
4+
{
5+
class Program
6+
{
7+
}
8+
}

0 commit comments

Comments
 (0)