New Release #10
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: New Release | |
on: | |
milestone: | |
types: [closed] | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Get Project Version | |
id: get_version | |
uses: mod-posh/[email protected] | |
with: | |
Filename: '${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj' | |
verbose: "verbose" | |
- name: Create Release Notes | |
uses: mod-posh/[email protected] | |
with: | |
milestone_number: ${{ github.event.milestone.number }} | |
verbose: 'verbose' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull Latest Changes | |
run: git pull origin ${{ github.ref_name }} | |
shell: bash | |
- name: Create Release | |
uses: mod-posh/[email protected] | |
with: | |
name: 'Release v${{ env.VERSION }}' | |
filename: 'RELEASE.md' | |
version: ${{ env.VERSION }} | |
verbose: 'verbose' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install PowerShell | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y powershell | |
- name: Install XMLDocMD Tool | |
run: dotnet tool install --global xmldocmd | |
- name: Build Project | |
run: dotnet build ${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj --configuration Release | |
- name: Publish Project | |
run: dotnet publish ${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj --configuration Release --output ./publish | |
- name: Generate Documentation | |
run: | | |
xmldocmd ./publish/${{ vars.PROJECT_NAME }}.dll Docs --visibility private --clean --namespace ${{ vars.PROJECT_NAMESPACE }} --namespace-pages | |
env: | |
PATH: ${{ github.runner.tool_cache }}/.dotnet/tools:$PATH:~/.dotnet/tools | |
- name: Run markdownlint-cli2-action | |
uses: DavidAnson/markdownlint-cli2-action@v16 | |
with: | |
globs: '**/*.md' | |
fix: true | |
- name: Run Inline PowerShell Commands | |
run: | | |
pwsh -command " | |
$ProjectName = "${{ vars.PROJECT_NAME }}" | |
$RootPath = "${{ github.workspace }}" | |
$GithubOwner = "${{ github.repository_owner }}" | |
$GithubRepo = "${{ github.repository }}" | |
$Project = [xml](Get-Content -Path "$($RootPath)/$($ProjectName)/$($ProjectName)"); | |
$PackageId = $Project.Project.PropertyGroup.PackageId; | |
Write-Host "PAckageId: $($PackageId)" | |
$readMe = Get-Item -Path "$($RootPath)\README.md" | |
$TableHeaders = "| Latest Version | Nuget.org | Issues | License | Discord |" | |
$Columns = "|-----------------|----------------|----------------|----------------|----------------|" | |
$VersionBadge = "[![Latest Version](https://img.shields.io/github/v/tag/$($GithubOwner)/$($ProjectName))]($($GithubRepo)/$($ProjectName)/tags)" | |
$IssueBadge = "[![GitHub issues](https://img.shields.io/github/issues/$($GithubOwner)/$($ProjectName))]($($GithubRepo)/$($ProjectName)/issues)" | |
$LicenseBadge = "[![GitHub license](https://img.shields.io/github/license/$($GithubOwner)/$($ProjectName))]($($GithubRepo)/$($ProjectName)/blob/master/LICENSE)" | |
$DiscordBadge = "[![Discord Server](https://assets-global.website-files.com/6257adef93867e50d84d30e2/636e0b5493894cf60b300587_full_logo_white_RGB.svg)](https://discord.com/channels/1044305359021555793/1044305781627035811)" | |
Write-Output $TableHeaders | Out-File $readMe.FullName -Force | |
Write-Output $Columns | Out-File $readMe.FullName -Append | |
Write-Output "| $($VersionBadge) | $($GalleryBadge) | $($IssueBadge) | $($LicenseBadge) | $($DiscordBadge) |" | Out-File $readMe.FullName -Append | |
Get-Content -Path "$($script:Root)\$($ProjectName).md" |Out-File -FilePath $readMe.FullName -Append | |
" | |
- name: Commit Documentation Changes | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Update documentation for release v${{ env.VERSION }}" | |
git push origin ${{ github.ref_name }} | |
if: success() |