-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
a4e2719
commit eb98c44
Showing
1 changed file
with
20 additions
and
14 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 |
---|---|---|
|
@@ -2,9 +2,9 @@ name: build and publish | |
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
branches: ["master"] | ||
pull_request: | ||
branches: [ "master" ] | ||
branches: ["master"] | ||
|
||
jobs: | ||
build: | ||
|
@@ -14,13 +14,7 @@ jobs: | |
|
||
- name: Setup MSBuild | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-api-key: ${{ secrets.NuGetAPIKey }} | ||
nuget-version: '5.x' | ||
|
||
|
||
- run: cd $GITHUB_WORKSPACE | ||
|
||
#- uses: actions/setup-python@v4 | ||
|
@@ -30,15 +24,15 @@ jobs: | |
#- name: Change package version | ||
# run: | | ||
# python -c "import urllib.request; urllib.request.urlretrieve('https://raw.githubusercontent.com/il-katta/jenkins-libs/master/resources/it/loopback/jenkins/projedit.py', 'projedit.py')" | ||
# foreach ($file in (Get-ChildItem ./ACUtils*/*.csproj) ) { | ||
# foreach ($file in (Get-ChildItem ./ACUtils*/*.csproj) ) { | ||
# $version = python projedit.py netstandard $file | ||
# Write-Output "::set-output name=PROJECT_VERSION::$version" | ||
# } | ||
# id: project_version | ||
|
||
- name: Restore packages | ||
run: nuget restore ACUtils.sln | ||
|
||
- name: Build | ||
run: | | ||
msbuild.exe ACUtils.sln /p:Configuration="Release" /p:Platform="Any CPU" /t:"Restore" | ||
|
@@ -59,7 +53,7 @@ jobs: | |
path: | | ||
dist/*.nupkg | ||
dist/*.snupkg | ||
#- name: Create release | ||
# uses: "marvinpinto/action-automatic-releases@latest" | ||
# with: | ||
|
@@ -69,13 +63,25 @@ jobs: | |
# files: | | ||
# dist/*.nupkg | ||
# dist/*.snupkg | ||
|
||
publish: | ||
needs: build | ||
runs-on: windows-2019 | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Setup NuGet | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-api-key: ${{ secrets.NuGetAPIKey }} | ||
nuget-version: "5.x" | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: nuget-packages | ||
path: . | ||
|
||
- name: Publish | ||
run: | | ||
foreach ($file in (Get-ChildItem dist/*.nupkg) ) { | ||
foreach ($file in (Get-ChildItem *.nupkg) ) { | ||
nuget push $file -Source https://api.nuget.org/v3/index.json -SkipDuplicate | ||
} | ||