Skip to content

Release

Release #5

Workflow file for this run

name: "Release"
on:
workflow_dispatch:
env:
ATC_EMAIL: 'atcnet.org@gmail.com'
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@v2
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
- name: ⚛️ Sets environment variables - branch-name
uses: nelonoel/branch-name@v1.0.1
- name: ⚛️ Sets environment variables - Nerdbank.GitVersioning
uses: dotnet/nbgv@master
with:
setAllVars: true
- name: ⚙️ Setup dotnet 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.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.Hosting.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols