Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
prepare-release:
name: 🚚 Prepare new release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && contains(fromJson('["major","minor"]'), github.event.inputs.versionIncrement)
if: contains(fromJson('["major","minor"]'), github.event.inputs.versionIncrement)
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
Expand All @@ -33,7 +33,6 @@ jobs:
run: |
echo "::error file=CHANGELOG.md::The unreleased section in the changelog is empty. Nothing to release."
exit 1

- name: ⚙️ Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
Expand Down
53 changes: 40 additions & 13 deletions .github/workflows/release-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,60 @@ concurrency: 'release-preview'

on:
workflow_run:
branches: [ main ]
workflows: [ 'verification' ]
types: [ completed ]
types: [completed]
branches: [main, v2]

workflow_dispatch:
inputs:
nugetRelease:
description: 'Release to NuGet? Set to "true" to release to NuGet.org as well as GPR.'
required: true
default: 'false'

jobs:
release-preview:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
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' }})
runs-on: ubuntu-latest
steps:

- name: 🛒 Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.0

- name: ⚙️ Setup dotnet 5.0.x
uses: actions/setup-dotnet@v1

- name: ⚙️ Setup dotnet versions
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
include-prerelease: true

- name: 🎨 Setup color
run: |
echo "DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION=1" >> $GITHUB_ENV
echo "TERM=xterm" >> $GITHUB_ENV

- name: 🛠️ Update tokens in project files
uses: cschleiden/replace-tokens@v1
with:
dotnet-version: '5.0.x'

- name: 🛠️ Building library in release mode
run: dotnet pack src/ -c release -p:ContinuousIntegrationBuild=true

files: '["*.csproj", "**/*.csproj"]'

- name: 🛠️ Packing library in release mode
run: |
dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true

- name: 🛠️ Upload library to GitHub Package Repository
run: echo "TODO"
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

- name: 🛠️ Upload library to NuGet.org repository
if: github.event.inputs.nugetRelease == 'true'
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
72 changes: 43 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,84 +8,98 @@ on:
types:
- closed
paths-ignore:
- 'docs/**'
- 'docs/**'

workflow_dispatch:
jobs:

jobs:
release:
name: 🎁 Publish new release
# Only run on manual dispatch or on merged 'release-' pull requests
if: github.ref == 'refs/heads/stable' ||
if: github.ref == 'refs/heads/stable' ||
github.event.pull_request.merged == true && contains(github.head_ref, 'release/v') == true
runs-on: ubuntu-latest
steps:

- name: 🛒 Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.BUNIT_BOT_TOKEN }}

- name: 🛠️ Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: Unreleased
path: ./CHANGELOG.md

- name: ☑ Check that release contains changes
if: steps.changelog_reader.outputs.changes == ''
run: |
echo "::error file=CHANGELOG.md::The unreleased section in the changelog is empty. Nothing to release."
exit 1

- name: ⚙️ Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.BUNIT_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BUNIT_BOT_GPG_KEY_PASSPHRASE }}

- name: ⚙️ Setup CI GIT
run: |
git config user.name "${{ steps.import_gpg.outputs.name }}"
git config user.email ${{ steps.import_gpg.outputs.email }}
git config --global user.signingkey ${{ steps.import_gpg.outputs.keyid }}
git config --global commit.gpgsign true
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.0
with:
setAllVars: true
- name: ⚙️ Setup dotnet 5.0.x
uses: actions/setup-dotnet@v1
setAllVars: true

- name: ⚙️ Setup dotnet versions
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
include-prerelease: true

- name: 🛠️ Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@1.2.1
with:
version: ${{ env.NBGV_SemVer2 }}

- name: 🛠️ Update changelog compare URLs
shell: bash
run: |
sed -i -E "s/compare\/([0-9]+\.[0-9]+\.[0-9]+)\.\.\.([0-9]+\.[0-9]+\.[0-9]+)/compare\/v\1...v\2/" CHANGELOG.md
sed -i -E "s/compare\/([0-9]+\.[0-9]+\.[0-9]+)\.\.\.HEAD/compare\/v\1...HEAD/" CHANGELOG.md

- name: 🛠️ Commit CHANGELOG.md to stable branch
run: |
git add CHANGELOG.md
git commit -S -m "Updated CHANGELOG.md for ${{ env.NBGV_SimpleVersion }} release"
echo "RELEASE_COMMIT_HASH=$(git rev-parse stable)" >> $GITHUB_ENV

- name: 🛠️ Building library in release mode
run: dotnet pack src/ -c release -p:ContinuousIntegrationBuild=true

- name: 🛠️ Update tokens in project files
uses: cschleiden/replace-tokens@v1
with:
files: '["*.csproj", "**/*.csproj"]'

- name: 🛠️ Packing library in release mode
run: |
dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true

- name: 🛠️ Upload library to NuGet.org repository
run: echo "TODO"
run: |
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols

- name: ⏩ Push stable branch
run: git push origin stable
Expand All @@ -97,19 +111,19 @@ jobs:
with:
tag_name: v${{ env.NBGV_SemVer2 }}
target_commitish: ${{ env.RELEASE_COMMIT_HASH }}
name: Release ${{ env.NBGV_SemVer2 }}
name: ${{ env.NBGV_SemVer2 }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: ${{ env.NBGV_PublicRelease == 'False' }}
- name: ⏩ Merge stable with main, push main

- name: ⏩ Merge stable with main, push to origin
id: mergeMainline
continue-on-error: true
run: |
run: |
git checkout main
git merge -S stable
git push origin main

- name: ⏭ Create pull request from stable to main when direct merge fails
if: steps.mergeMainline.outcome == 'failure'
uses: thomaseizinger/create-pull-request@1.0.0
Expand All @@ -122,5 +136,5 @@ jobs:
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
body: |
Hi @${{ github.actor }}

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.
46 changes: 36 additions & 10 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,59 @@ name: verification
on:
push:
branches:
- main
- main
- v2
paths:
- 'src/**'
- 'src/**'
- 'tests/**'

pull_request:
types:
- opened
- synchronize
- reopened
- reopened

workflow_dispatch:

concurrency:
group: verification-${{ github.ref }}-1
cancel-in-progress: true

jobs:
verify:
name: 👌 Verify library
runs-on: ubuntu-latest
verify-bunit:
name: 👌 Verify bUnit
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: ⚙️ Setup dotnet versions
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
include-prerelease: true

- name: 🎨 Setup color
if: matrix.os != 'windows-latest'
run: |
echo "DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION=1" >> $GITHUB_ENV
echo "TERM=xterm" >> $GITHUB_ENV

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.0
with:
setAllVars: true
- name: 🛠️ Building library in release mode
run: dotnet build src

- name: 🛠️ Building library in release mode
run: dotnet build
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

Test

## [2.10.0] - 2021-05-03

Test
Expand Down
14 changes: 0 additions & 14 deletions src/Program.cs

This file was deleted.

8 changes: 8 additions & 0 deletions src/ProjectA/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ProjectA
{
class Program
{
}
}
8 changes: 8 additions & 0 deletions src/ProjectA/ProjectA.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>ProjectA</AssemblyName>
</PropertyGroup>

</Project>
8 changes: 8 additions & 0 deletions src/ProjectB/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace ProjectB
{
class Program
{
}
}
9 changes: 9 additions & 0 deletions src/ProjectB/ProjectB.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>ProjectB</AssemblyName>
<VersionSuffix>preview</VersionSuffix>
</PropertyGroup>

</Project>
8 changes: 0 additions & 8 deletions src/workflows.csproj

This file was deleted.

2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.10",
"version": "2.11",
"assemblyVersion": {
"precision": "revision"
},
Expand Down
Loading