-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 changed file
with
67 additions
and
47 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 |
---|---|---|
|
@@ -15,60 +15,80 @@ env: | |
|
||
jobs: | ||
|
||
build: | ||
name: Build Package | ||
runs-on: windows-2016 # using windows agent for net472 build. | ||
# build: | ||
# name: Build Package | ||
# runs-on: windows-2016 # using windows agent for net472 build. | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET Core SDK ${{ env.NETCORE_VERSION }} | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.NETCORE_VERSION }} | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Setup .NET Core SDK ${{ env.NETCORE_VERSION }} | ||
# uses: actions/setup-dotnet@v1 | ||
# with: | ||
# dotnet-version: ${{ env.NETCORE_VERSION }} | ||
|
||
- name: Restore | ||
working-directory: ${{ env.GIT_REPO_ROOT }} | ||
run: dotnet restore ${{ env.SOLUTION_FILE }} | ||
# - name: Restore | ||
# working-directory: ${{ env.GIT_REPO_ROOT }} | ||
# run: dotnet restore ${{ env.SOLUTION_FILE }} | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/setup-msbuild@v1 | ||
# - name: Add MSBuild to PATH | ||
# uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Build | ||
working-directory: ${{ env.GIT_REPO_ROOT }} | ||
run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Debug --no-restore | ||
# - name: Build | ||
# working-directory: ${{ env.GIT_REPO_ROOT }} | ||
# run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Debug --no-restore | ||
|
||
- name: Pack | ||
working-directory: ${{ env.GIT_REPO_ROOT }} | ||
run: dotnet pack ${{ env.SOLUTION_FILE }} --configuration Debug -o finalpackage --no-build -p:PackageVersion=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }} | ||
# - name: Pack | ||
# working-directory: ${{ env.GIT_REPO_ROOT }} | ||
# run: dotnet pack ${{ env.SOLUTION_FILE }} --configuration Debug -o finalpackage --no-build -p:PackageVersion=${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }} | ||
|
||
- name: Publish artifact | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: nupkg | ||
path: ${{ env.GIT_REPO_ROOT }}/finalpackage | ||
# - name: Publish artifact | ||
# uses: actions/upload-artifact@master | ||
# with: | ||
# name: nupkg | ||
# path: ${{ env.GIT_REPO_ROOT }}/finalpackage | ||
|
||
deploy: | ||
needs: build | ||
#if: github.ref == 'refs/heads/master' | ||
name: Deploy Packages | ||
runs-on: [self-hosted, linux, x64] | ||
steps: | ||
- name: Download Package artifact | ||
uses: actions/download-artifact@master | ||
with: | ||
name: nupkg | ||
path: ./nupkg | ||
# deploy: | ||
# needs: build | ||
# #if: github.ref == 'refs/heads/master' | ||
# name: Deploy Packages | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Download Package artifact | ||
# uses: actions/download-artifact@master | ||
# with: | ||
# name: nupkg | ||
# path: ./nupkg | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
with: | ||
nuget-api-key: ${{ secrets.KLONDIKE_API_KEY }} | ||
nuget-version: latest | ||
# - name: Setup NuGet | ||
# uses: NuGet/[email protected] | ||
# with: | ||
# nuget-api-key: ${{ secrets.KLONDIKE_API_KEY }} | ||
# nuget-version: latest | ||
|
||
- name: Setup .NET Core SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.NETCORE_VERSION }} | ||
# - name: Setup .NET Core SDK | ||
# uses: actions/setup-dotnet@v1 | ||
# with: | ||
# dotnet-version: ${{ env.NETCORE_VERSION }} | ||
|
||
- name: Push to NuGet | ||
run: dotnet nuget push nupkg/**/*.nupkg -k ${{ secrets.KLONDIKE_API_KEY }} -s https://bk-lib-nuget.agodadev.io/api/packages --skip-duplicate | ||
# - name: Push to NuGet | ||
# run: dotnet nuget push nupkg/**/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org --skip-duplicate | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Draft Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }} | ||
release_name: ${{ env.MAJOR_MINOR_VERSION }}${{ github.run_number }} | ||
draft: true | ||
prerelease: false | ||
|
||
- uses: eregon/publish-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
release_id: ${{ steps.create_release.outputs.id }} |