Skip to content

Commit

Permalink
feat: Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
asvol committed Sep 16, 2024
1 parent b2b53e5 commit 8f79a29
Show file tree
Hide file tree
Showing 147 changed files with 11,366 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/nuget_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy Nuget

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

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 Nuget
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Drones.Gui.Api.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}
- 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 }}
69 changes: 69 additions & 0 deletions .github/workflows/release-debug-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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 }}
74 changes: 74 additions & 0 deletions .github/workflows/release-pre-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Publish Pre-Release Version

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc"

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 Nuget
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Drones.Gui.Api.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }} --prerelease
- 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 }} --prerelease
Loading

0 comments on commit 8f79a29

Please sign in to comment.