Skip to content

Versioning-and-release #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 11, 2024
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
32 changes: 27 additions & 5 deletions .github/workflows/dotnet.yml → .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
paths:
- "src/**"
- "examples/**"
- "tests/**"

jobs:
build:
Expand Down Expand Up @@ -65,6 +64,15 @@ jobs:
- name: Test
run: dotnet test --no-build --configuration ${{ env.DOTNET_CONFIGURATION }} --collect "XPlat Code Coverage" --results-directory test-results --logger trx

- name: Publish NuGet package
run: dotnet pack --no-build -c ${{ env.DOTNET_CONFIGURATION }} -o ./nuget -p:VersionSuffix='alpha.${{ github.run_number }}'

- name: Publish NuGet packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nuget

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
Expand Down Expand Up @@ -94,3 +102,17 @@ jobs:
name: ".NET Tests"
path: "*.trx"
reporter: dotnet-trx

publish-github-packages:
needs: build
runs-on: ubuntu-latest
environment:
name: github-packages
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages

- name: Publish to GitHub packages
run: dotnet nuget push ./*.nupkg --source "https://nuget.pkg.github.com/communitytoolkit/index.json" --api-key ${{ secrets.GITHUB_TOKEN }}
132 changes: 132 additions & 0 deletions .github/workflows/dotnet-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: .NET main

on:
push:
branches: ["main"]
paths:
- "src/**"
- "examples/**"
- "tests/**"

jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_CONFIGURATION: Release

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/setup-java@v4
name: Set up Java
with:
distribution: "microsoft"
java-version: "21"
- uses: actions/setup-node@v4
name: Set up Node.js
with:
node-version: "latest"

- uses: actions/cache@v4
name: Cache NuGet packages
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/cache@v4
name: Cache Java Docker images
with:
path: /var/lib/docker/image
key: ${{ runner.os }}-docker-${{ hashFiles('examples/java/CommunityToolkit.Aspire.Java.Spring.Maven/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-

- name: Install Aspire workload
run: dotnet workload install aspire
- name: Setup .NET dev certs
run: |
dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install
- name: Setup Node projects
run: |
npm install -g @azure/static-web-apps-cli
cd examples/swa/CommunityToolkit.Aspire.StaticWebApps.WebApp
npm ci

- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration ${{ env.DOTNET_CONFIGURATION }}
- name: Test
run: dotnet test --no-build --configuration ${{ env.DOTNET_CONFIGURATION }} --collect "XPlat Code Coverage" --results-directory test-results --logger trx

- name: Publish NuGet package
run: dotnet pack --no-build -c ${{ env.DOTNET_CONFIGURATION }} -o ./nuget -p:VersionSuffix='beta.${{ github.run_number }}'

- name: Publish NuGet packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nuget

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
${{ github.workspace }}/test-results/**

test-reporting:
permissions:
contents: read
actions: read
checks: write
runs-on: ubuntu-latest
needs: build
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: ".NET Tests"
path: "*.trx"
reporter: dotnet-trx

publish-nuget:
needs: build
runs-on: ubuntu-latest
environment:
name: nuget
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages

- name: Publish to NuGet
run: dotnet nuget push ./*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY }}

publish-github-packages:
needs: build
runs-on: ubuntu-latest
environment:
name: github-packages
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages

- name: Publish to GitHub packages
run: dotnet nuget push ./*.nupkg --source "https://nuget.pkg.github.com/communitytoolkit/index.json" --api-key ${{ secrets.GITHUB_TOKEN }}
149 changes: 149 additions & 0 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: .NET release

on:
push:
tags:
- "v*"
paths:
- "src/**"
- "examples/**"
- "tests/**"

jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_CONFIGURATION: Release

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/setup-java@v4
name: Set up Java
with:
distribution: "microsoft"
java-version: "21"
- uses: actions/setup-node@v4
name: Set up Node.js
with:
node-version: "latest"

- uses: actions/cache@v4
name: Cache NuGet packages
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/cache@v4
name: Cache Java Docker images
with:
path: /var/lib/docker/image
key: ${{ runner.os }}-docker-${{ hashFiles('examples/java/CommunityToolkit.Aspire.Java.Spring.Maven/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-

- name: Install Aspire workload
run: dotnet workload install aspire
- name: Setup .NET dev certs
run: |
dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install
- name: Setup Node projects
run: |
npm install -g @azure/static-web-apps-cli
cd examples/swa/CommunityToolkit.Aspire.StaticWebApps.WebApp
npm ci

- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration ${{ env.DOTNET_CONFIGURATION }}
- name: Test
run: dotnet test --no-build --configuration ${{ env.DOTNET_CONFIGURATION }} --collect "XPlat Code Coverage" --results-directory test-results --logger trx
- name: Publish NuGet package
run: dotnet pack --no-build -c ${{ env.DOTNET_CONFIGURATION }} -o ./nuget

- name: Publish NuGet packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nuget

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
${{ github.workspace }}/test-results/**

test-reporting:
permissions:
contents: read
actions: read
checks: write
runs-on: ubuntu-latest
needs: build
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: ".NET Tests"
path: "*.trx"
reporter: dotnet-trx

release:
needs: build
runs-on: ubuntu-latest
environment:
name: release
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
./*.nupkg

publish-nuget:
needs: release
runs-on: ubuntu-latest
environment:
name: nuget
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages

- name: Publish to NuGet
run: dotnet nuget push ./*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_API_KEY }}

publish-github-packages:
needs: release
runs-on: ubuntu-latest
environment:
name: github-packages
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: nuget-packages

- name: Publish to GitHub packages
run: dotnet nuget push ./*.nupkg --source "https://nuget.pkg.github.com/communitytoolkit/index.json" --api-key ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ appsettings.*.json
*.orig
test-results
TestResults
_site
nuget
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The .NET Aspire Community Toolkit also has a list of issues that are labeled as

## 📝 Add or Improve Documentation <a name="docs"></a>

TBC
The documentation for the .NET Aspire Community Toolkit is available on the [GitHub Pages site](https://communitytoolkit.github.io/aspire/). If you find any issues with the documentation or want to add more information, you can contribute by submitting a PR.

## 🚀 Create, Submit or Review Pull Request <a name="pr"></a>

Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<AspireVersion>8.2.0</AspireVersion>
<AspNetCoreVersion>8.0.7</AspNetCoreVersion>
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>

<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<!-- .NET packages -->
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.2" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<!-- OpenTelemetry packages -->
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="$(OpenTelemetryVersion)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OpenTelemetryVersion)" />
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ All features are contributed by you, our amazing .NET community, and maintained

This repository contains the source code for the .NET Aspire Community Toolkit, a collection of community created Integrations and extensions for [.NET Aspire](https://aka.ms/dotnet/aspire).

| Package | Latest stable | Latest Preview | Description |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps`]() | [![CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://img.shields.io/nuget/v/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps)](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps/) | [![CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps)](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps/absoluteLatest) | A hosting component for the [Azure Static Web Apps emulator](https://learn.microsoft.com/azure/static-web-apps/static-web-apps-cli-overview) (Note: this does not support deployment of a project to Azure Static Web Apps). |
| [`CommunityToolkit.Aspire.Java`]() | [![CommunityToolkit.Aspire.Java](https://img.shields.io/nuget/v/CommunityToolkit.Aspire.Java)](https://nuget.org/packages/CommunityToolkit.Aspire.Java/) | [![CommunityToolkit.Aspire.Java](https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.Java)](https://nuget.org/packages/CommunityToolkit.Aspire.Java/absoluteLatest) | A component for running Java code in .NET Aspire either using the local JDK or using a container. |
| Package | Latest stable | Latest Preview | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps`](https://communitytoolkit.github.io/aspire/integrations/hosting-azure-static-web-apps) | [![CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://img.shields.io/nuget/v/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps)](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps/) | [![CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps)](https://github.com/CommunityToolkit/Aspire/pkgs/nuget/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps) | A hosting component for the [Azure Static Web Apps emulator](https://learn.microsoft.com/azure/static-web-apps/static-web-apps-cli-overview) (Note: this does not support deployment of a project to Azure Static Web Apps). |
| [`CommunityToolkit.Aspire.Java`](https://communitytoolkit.github.io/aspire/integrations/hosting-java) | [![CommunityToolkit.Aspire.Java](https://img.shields.io/nuget/v/CommunityToolkit.Aspire.Java)](https://nuget.org/packages/CommunityToolkit.Aspire.Java/) | [![CommunityToolkit.Aspire.Java](https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.Java)](https://github.com/CommunityToolkit/Aspire/pkgs/nuget/CommunityToolkit.Aspire.Hosting.Java) | A component for running Java code in .NET Aspire either using the local JDK or using a container. |

## 🙌 Getting Started

TBC
Each of the integrations in the toolkit is available as a NuGet package, and can be added to your .NET project. Refer to the table above for the available integrations and the documentation on how to use them.

## 📃 Documentation

TBC
Documentation for the .NET Aspire Community Toolkit is available on the [GitHub Pages site](https://communitytoolkit.github.io/aspire/).

## 🚀 Contribution

Expand Down
Empty file added docs/faq.md
Empty file.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ The Community Toolkit consists of a collection of NuGet packages that can be add

It is important to understand that the .NET Aspire Community Toolkit is not a part of the official .NET Aspire project. The toolkit is a community-driven project that is maintained by the community and is not officially supported by the .NET Aspire team.

To understand more about the role of the .NET Aspire Community Toolkit, please read the [FAQ](faq.md).
To understand more about the role of the .NET Aspire Community Toolkit, please read the [FAQ](faq.md).
Loading