Merge pull request #7 from nutdotnet/6-full-cd #24
Workflow file for this run
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: build-release | |
on: | |
push: | |
tags: "v*" | |
branches: "main" | |
env: | |
PRIMARY_FOLDER: AGauge | |
NUGET_API_URL: https://api.nuget.org/v3/index.json | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Extract version info | |
id: exVer | |
run: .\.github\get-ver.ps1 ${{ github.ref }} | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
- name: Build Project | |
run: > | |
dotnet build ${{ env.PRIMARY_FOLDER }}\AGauge.csproj | |
--nologo | |
-c Release | |
-p:Version=${{ steps.exVer.outputs.ASMVER }} | |
-p:PackageVersion=${{ steps.exVer.outputs.SEMVER }} | |
- name: Push to NuGet | |
run: > | |
dotnet nuget push | |
${{ env.PRIMARY_FOLDER }}\bin\Release\*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source ${{ env.NUGET_API_URL }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AGauge-Release-CIBuild_${{ github.run_number }} | |
path: ${{ env.PRIMARY_FOLDER }}\bin\Release | |
if-no-files-found: error | |
- name: Create GH Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
prerelease: ${{ steps.exVer.outputs.ISPRERELEASE }} | |
files: ${{ env.PRIMARY_FOLDER }}/bin/Release/* | |
fail_on_unmatched_files: true | |
generate_release_notes: true |