Release #40
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: | |
workflow_dispatch: | |
env: | |
ATC_EMAIL: 'atcnet.org@gmail.com' | |
ATC_NAME: 'Atc-Net' | |
NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json' | |
VERSION: 1.1.${{ github.run_number }} | |
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: ⚙️ Setup dotnet 6.0.x | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: 🧹 Clean | |
run: dotnet clean -c Release && dotnet nuget locals all --clear | |
- name: 🛠️ Building library in release mode | |
run: dotnet pack -c Release -o packages -p:UseSourceLink=true -p:Version=${{ env.VERSION }} -p:PackageVersion=${{ env.VERSION }} | |
- name: 🛠️ Building preview library in release mode | |
run: dotnet pack -c Release -o packages -p:UseSourceLink=true -p:Version=${{ env.VERSION }} -p:PackageVersion=${{ env.VERSION }}-preview -p:DefineConstants=PREVIEW | |
- name: 🗳️ Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Packages | |
path: | | |
packages/*.nupkg | |
README.md | |
- 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: 📦 Push packages to NuGet | |
run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_KEY }} -s ${{ env.NUGET_REPO_URL }} --skip-duplicate --no-symbols |