DefaultDocumentation 1.0.0-beta04 #37
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: release | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
source-url: https://api.nuget.org/v3/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} | |
- name: Decrypte snk file | |
env: | |
SNK_KEY: ${{ secrets.SNK_KEY }} | |
run: gpg --quiet --batch --yes --decrypt --passphrase="$env:SNK_KEY" --output ds.snk ds.snk.gpg | |
- name: Create packages | |
run: | | |
dotnet pack source -c Release -o build /p:Version=${{ github.event.release.tag_name }} /p:SignAssembly=true | |
- name: Create RELEASE.txt | |
run: | | |
type documentation\NEXT_RELEASENOTES.txt | Out-File build\RELEASE.txt | |
echo "" | Out-File build\RELEASE.txt -Append | |
echo "- [api nuget package](https://www.nuget.org/packages/DefaultDocumentation.Api/${{ github.event.release.tag_name }})" | Out-File build\RELEASE.txt -Append | |
echo "- [markdown nuget package](https://www.nuget.org/packages/DefaultDocumentation.Markdown/${{ github.event.release.tag_name }})" | Out-File build\RELEASE.txt -Append | |
echo "- [msbuild task nuget package](https://www.nuget.org/packages/DefaultDocumentation/${{ github.event.release.tag_name }})" | Out-File build\RELEASE.txt -Append | |
echo "- [dotnet tool nuget package](https://www.nuget.org/packages/DefaultDocumentation.Console/${{ github.event.release.tag_name }})" | Out-File build\RELEASE.txt -Append | |
- name: Update release | |
uses: tubone24/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
release_name: DefaultDocumentation ${{ github.event.release.tag_name }} | |
prerelease: ${{ contains(github.event.release.tag_name, '-') }} | |
body_path: .\build\RELEASE.txt | |
- name: Clear NEXT_RELEASENOTES.txt | |
run: echo "" | Out-File documentation\NEXT_RELEASENOTES.txt -NoNewLine | |
- name: Generate documentation | |
run: | | |
dotnet run --project source\DefaultDocumentation.Console\DefaultDocumentation.Console.csproj --framework net8.0 -c Release --ConfigurationFilePath source\DefaultDocumentation.Api\DefaultDocumentation.json | |
dotnet run --project source\DefaultDocumentation.Console\DefaultDocumentation.Console.csproj --framework net8.0 -c Release --ConfigurationFilePath source\DefaultDocumentation.Markdown\DefaultDocumentation.json | |
- name: Publish packages | |
run: dotnet nuget push build\*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
- name: Commit RELEASENOTES and documentation api | |
if: "!contains(github.event.release.tag_name, '-')" | |
run: | | |
git config --local user.email "$(git log --format='%ae' HEAD^!)" | |
git config --local user.name "$(git log --format='%an' HEAD^!)" | |
git add . | |
git commit -m "Updated RELEASENOTES and documentation api" | |
git push origin HEAD:master |