Skip to content

Commit

Permalink
fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
acattaneo-bitagora committed Feb 10, 2023
1 parent a4e2719 commit eb98c44
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build and publish

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:
build:
Expand All @@ -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
Expand All @@ -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"
Expand All @@ -59,7 +53,7 @@ jobs:
path: |
dist/*.nupkg
dist/*.snupkg
#- name: Create release
# uses: "marvinpinto/action-automatic-releases@latest"
# with:
Expand All @@ -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
}

0 comments on commit eb98c44

Please sign in to comment.