forked from rdtek/LibEDF
-
Notifications
You must be signed in to change notification settings - Fork 7
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
3 changed files
with
113 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
env: | ||
DOTNET_VERSION: 7.0.x | ||
BUILD_TARGET: .\Project\SharpLibEuropeanDataFormat.sln | ||
|
||
|
||
jobs: | ||
build: | ||
name: .NET Build | ||
runs-on: windows-latest | ||
# Don't build for release the publish workflow will do that to | ||
if: "!startsWith(github.event.head_commit.message, 'Release v')" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use .NET ${{ env.DOTNET_VERSION }} | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Build | ||
run: dotnet build ${{ env.BUILD_TARGET }} -c Release |
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,57 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
env: | ||
DOTNET_VERSION: 7.0.x | ||
BUILD_TARGET: .\Project\SharpLibEuropeanDataFormat.sln | ||
|
||
jobs: | ||
build: | ||
name: .NET Build | ||
runs-on: windows-latest | ||
if: "startsWith(github.event.head_commit.message, 'Release v')" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use .NET ${{ env.DOTNET_VERSION }} | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Build | ||
run: dotnet build ${{ env.BUILD_TARGET }} -c Release | ||
|
||
- name: Pack | ||
run: dotnet pack ${{ env.BUILD_TARGET }} -c Release --no-build | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2.3.1 | ||
with: | ||
name: nuget-packages | ||
path: "**/*.nupkg" | ||
|
||
|
||
publish: | ||
name: Publish to NuGet | ||
runs-on: windows-latest | ||
needs: build | ||
if: "startsWith(github.event.head_commit.message, 'Release v')" | ||
|
||
steps: | ||
- name: Use NuGet | ||
uses: NuGet/setup-nuget@v1.0.5 | ||
with: | ||
nuget-version: latest | ||
nuget-api-key: ${{ secrets.NUGET_API_KEY }} | ||
|
||
- name: Fetch artifacts | ||
uses: actions/download-artifact@v2.1.0 | ||
with: | ||
name: nuget-packages | ||
|
||
- name: Publish | ||
run: nuget push **\*.nupkg -Source https://api.nuget.org/v3/index.json |
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