Skip to content

Release

Release #183

Workflow file for this run

name: "Release"
on:
workflow_dispatch:
env:
ATC_EMAIL: '[email protected]'
ATC_NAME: 'Atc-Net'
NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json'
jobs:
release:
if: github.ref == 'refs/heads/stable'
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
- name: ⚛️ Sets environment variables - branch-name
uses: nelonoel/[email protected]
- name: ⚛️ Sets environment variables - Nerdbank.GitVersioning
uses: dotnet/nbgv@master
with:
setAllVars: true
- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: 🔁 Restore packages
run: dotnet restore
- name: 🛠️ Building library in release mode
run: dotnet build -c Release --no-restore /p:UseSourceLink=true
- name: ⏩ Merge to release-branch
run: |
git config --local user.email ${{ env.ATC_EMAIL }}
git config --local user.name ${{ env.ATC_NAME }}
git checkout release
git merge --ff-only stable
git push origin release
- name: 🗳️ Creating library package for release
run: dotnet pack -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH_NAME /p:PublicRelease=true
- name: 📦 Push packages to NuGet
run: |
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.CodeAnalysis.CSharp.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.CodeDocumentation.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Console.Spectre.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.DotNet.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.OpenApi.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Rest.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Rest.Extended.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Rest.FluentAssertions.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Rest.HealthChecks.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.XUnit.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols