Support for .net 8 (#1) #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automated build and release | |
on: | |
push: | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
permissions: | |
contents: write | |
# discussions: write # Uncomment this line if you want to create discussions | |
# see https://github.com/softprops/action-gh-release/tree/v2.0.4?tab=readme-ov-file#-customizing | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 👨💻 Check-out code | |
uses: actions/checkout@v4 | |
- name: 👨🔧 Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: 🔍 Enable problem matchers | |
run: echo "::add-matcher::.github/matchers/dotnet.json" | |
- name: 🦸♂️ Restore steriods # this is the caching step, remove if you don't think you need it | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget | |
- name: 🎒 Load packages | |
run: dotnet restore ./src/Svrooij.PowerShell.DependencyInjection/Svrooij.PowerShell.DependencyInjection.csproj | |
- name: 🛠️ Build code | |
run: dotnet build ./src/Svrooij.PowerShell.DependencyInjection/Svrooij.PowerShell.DependencyInjection.csproj --configuration Release --no-restore -p:Version=$("${{ github.ref_name }}".Substring(1)) | |
- name: 📦 Package library | |
run: dotnet pack ./src/Svrooij.PowerShell.DependencyInjection/Svrooij.PowerShell.DependencyInjection.csproj --configuration Release --no-build -p:Version=$("${{ github.ref_name }}".Substring(1)) | |
- name: ✈️ Publish package | |
run: dotnet nuget push ./src/Svrooij.PowerShell.DependencyInjection/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_TOKEN }} | |
- name: ✅ Create release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
./src/Svrooij.PowerShell.DependencyInjection/bin/Release/*.nupkg | |
tag_name: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
body: | | |
## Release ${{ github.ref_name }} | |
This is the release for ${{ github.ref_name }}. | |
generate_release_notes: true | |
append_body: true |