-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
ci: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Git Semantic Version | ||
id: gitversion | ||
uses: PaulHatch/semantic-version@v5.3.0 | ||
with: | ||
tag_prefix: "" | ||
- name: Set Version Environment Variables | ||
run: | | ||
echo "ASSEMBLY_VERSION=${{ steps.gitversion.outputs.major }}.0.0.0" >> "$GITHUB_ENV" | ||
echo "FILE_VERSION=${{ steps.gitversion.outputs.version }}.${{ github.run_number }}" >> "$GITHUB_ENV" | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
- name: Display .NET Version | ||
run: dotnet --version | ||
- name: Restore | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore --configuration Release -p:AssemblyVersion=${{ env.ASSEMBLY_VERSION }} -p:FileVersion=${{ env.FILE_VERSION }} | ||
run: dotnet build --no-restore --configuration Release | ||
- name: Test | ||
run: dotnet test --configuration Release --no-restore --verbosity normal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish NuGet Package | ||
on: | ||
push: | ||
tags: ["*"] | ||
workflow_dispatch: | ||
jobs: | ||
publish: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Git Semantic Version | ||
id: gitversion | ||
uses: PaulHatch/semantic-version@v5.3.0 | ||
with: | ||
tag_prefix: "" | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
- name: Display .NET Version | ||
run: dotnet --version | ||
- name: Build | ||
run: dotnet build src/CsvHelper/CsvHelper.proj --configuration Release -p:AssemblyVersion=${{ steps.gitversion.outputs.major }}.0.0.0 -p:FileVersion=${{ steps.gitversion.outputs.version }}.${{ github.run_number }} | ||
- name: Create NuGet Package | ||
run: dotnet pack src/CsvHelper/CsvHelper.proj --no-restore --configuration Release -o output -p:PackageVersion=${{ steps.gitversion.outputs.version }} | ||
- name: Display Output | ||
run: dir output | ||
- name: Publish NuGet Package | ||
run: dotnet nuget push output/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |