Skip to content

Release

Release #13

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.Kepware.Configuration.Contracts.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'Atc.Kepware.Configuration.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols
dotnet nuget push ${GITHUB_WORKSPACE}/packages/'atc-kepware-configuration.'${NBGV_NuGetPackageVersion}'.nupkg' -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols