Skip to content

feat: Init commit

feat: Init commit #1

name: Build and Publish Debug Version
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-dev"
env:
PATH_TO_PROJECTS: ${{ github.workspace }}\src
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output\
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
GITHUB_PACKAGES_URL: 'https://nuget.pkg.github.com/asv-soft/index.json'
jobs:
deploy:
name: 'Deploy'
runs-on: windows-2019
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Setup .Net
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.x.x
- name: Get version
id: version
uses: battila7/get-version-action@v2
- name: Check version
run: echo ${{ steps.version.outputs.version-without-v }}
- name: Set project version
run: |
dotnet tool install -g dotnet-setversion
setversion ${{ steps.version.outputs.version-without-v }} ${{ env.PATH_TO_PROJECTS }}\Asv.Drones.Gui.Api\Asv.Drones.Gui.Api.csproj
- name: Add NuGet source
run: |
dotnet nuget add source ${{ env.GITHUB_PACKAGES_URL }} --username '${{ secrets.USER_NAME }}' --password '${{ secrets.GIHUB_NUGET_AUTH_TOKEN }}' --store-password-in-clear-text
- name: Restore dependencies
run: |
cd src
dotnet restore
- name: Build projects
run: |
cd src
dotnet build -c Release --no-restore
- name: Running all tests
run: |
cd src
dotnet test --no-restore --verbosity normal
- name: Pack projects to Nuget
run: |
cd src
dotnet pack -c Release --no-build --no-restore -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Push packages to Github
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Drones.Gui.Api.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} -s ${{ env.GITHUB_PACKAGES_URL }}