Skip to content

Commit

Permalink
fix(workflows): nuget job
Browse files Browse the repository at this point in the history
update: actions/checkout@v3
  • Loading branch information
jtalborough committed Nov 14, 2022
1 parent c3bb32b commit 3a98ba9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/essentialsplugins-betabuilds-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
# First we checkout the source repo
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
# Fetch all tags
Expand Down Expand Up @@ -219,10 +219,23 @@ jobs:
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push_Nuget_Package:
Push_Nuget_Package:
needs: Build_Project
runs-on: windows-2019
steps:
- name: Download Build Version Info
uses: actions/download-artifact@v1
with:
name: Version
- name: Set Version Number
shell: powershell
run: |
Get-ChildItem "./Version"
$version = Get-Content -Path ./Version/version.txt
Write-Host "Version: $version"
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
- name: Download Build output
uses: actions/download-artifact@v1
with:
Expand All @@ -234,10 +247,10 @@ jobs:
Remove-Item -Path .\*.zip
- name: Copy Files to root & delete output directory
run: |
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz","*.md")
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
Remove-Item -Path .\output -Recurse
- name: Get nuget File
- name: Get nuget File
shell: powershell
run: |
$nuspec_file = Get-ChildItem *.nuspec -recurse
Expand All @@ -247,12 +260,12 @@ jobs:
- name: Add Github Packages source
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
# Pushes to nuget, not needed unless publishing publicly
#- name: Add nuget.org API Key
# run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
- name: Add nuget.org API Key
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
- name: Create nuget package
run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ needs.Build_Project.outputs.version }}
run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ env.VERSION }}
- name: Publish nuget package to Github registry
run: nuget push **/*.nupkg -source github
# Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org
#- name: Publish nuget package to nuget.org
# run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
- name: Publish nuget package to nuget.org
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
29 changes: 21 additions & 8 deletions .github/workflows/essentialsplugins-releasebuilds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
# First we checkout the source repo
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Version Number
Expand Down Expand Up @@ -168,6 +168,19 @@ jobs:
needs: Build_Project
runs-on: windows-2019
steps:
- name: Download Build Version Info
uses: actions/download-artifact@v1
with:
name: Version
- name: Set Version Number
shell: powershell
run: |
Get-ChildItem "./Version"
$version = Get-Content -Path ./Version/version.txt
Write-Host "Version: $version"
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Remove-Item -Path ./Version/version.txt
Remove-Item -Path ./Version
- name: Download Build output
uses: actions/download-artifact@v1
with:
Expand All @@ -179,10 +192,10 @@ jobs:
Remove-Item -Path .\*.zip
- name: Copy Files to root & delete output directory
run: |
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz")
Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz","*.md")
Get-ChildItem -Path .\output\* | Copy-Item -Destination .\
Remove-Item -Path .\output -Recurse
- name: Get nuget File
- name: Get nuget File
shell: powershell
run: |
$nuspec_file = Get-ChildItem *.nuspec -recurse
Expand All @@ -192,12 +205,12 @@ jobs:
- name: Add Github Packages source
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
# Pushes to nuget, not needed unless publishing publicly
#- name: Add nuget.org API Key
# run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
- name: Add nuget.org API Key
run: nuget setApiKey ${{ secrets.NUGET_API_KEY }}
- name: Create nuget package
run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ needs.Build_Project.outputs.version }}
run: nuget pack "./${{ env.NUSPEC_FILE}}.nuspec" -version ${{ env.VERSION }}
- name: Publish nuget package to Github registry
run: nuget push **/*.nupkg -source github
# Pushes to nuget, not needed unless publishing publicly >> this pushes package to nuget.org
#- name: Publish nuget package to nuget.org
# run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json
- name: Publish nuget package to nuget.org
run: nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json

0 comments on commit 3a98ba9

Please sign in to comment.