CI Build & Package #37
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: CI Build & Package | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Get Current Time | |
id: build_date | |
run: | | |
$CurrentDateTime = Get-Date -Format "yyyyMMdd-HHmmss" | |
echo "::set-output name=date::$CurrentDateTime" | |
echo "$CurrentDateTime" | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Restore Dependencies | |
run: dotnet restore "src/Simple.OData.Client.sln" | |
- name: Build | |
run: dotnet build "src/Simple.OData.Client.sln" --no-restore --configuration Debug --verbosity minimal | |
- name: Test | |
run: dotnet test "src/Simple.OData.Client.sln" --no-build --configuration Debug --verbosity minimal | |
- name: Create NuGet Packages | |
run: dotnet pack src/Simple.OData.Client.sln --no-build --output packages /p:Configuration=debug /p:Version="${{ vars.CI_VERSION_MAJORMINOR }}-CI-${{ steps.build_date.outputs.date }}" | |
# - name: Upload Artifacts | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: nuget-packages | |
# path: packages | |
- name: Push to NuGet | |
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |