(NuGet) NuGet Release #19
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
name: (NuGet) NuGet Release | |
on: | |
workflow_run: | |
workflows: [ "Build" ] | |
types: | |
- completed | |
jobs: | |
nuget_release: | |
name: NuGet Release | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' }} | |
runs-on: ubuntu-20.04 | |
env: | |
# Nuget Setup | |
NUGET_VERSION: 'latest' | |
NUGET_OUTPUT: ${{ github.workspace }}/nuget/ | |
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} | |
NUGET_FEED: https://api.nuget.org/v3/index.json | |
# Project Setup | |
PROJECT_NAME: ${{ github.event.repository.name }} | |
steps: | |
- name: Checkout master | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
fetch-depth: 0 | |
- name: Get version | |
shell: bash | |
run: | | |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1) | |
echo "VERSION=$tag_check" >> $GITHUB_ENV | |
- name: Download a single artifact | |
uses: aochmann/actions-download-artifact@1.0.2 | |
with: | |
name: nuget_${{ env.PROJECT_NAME }}.${{ env.VERSION }} | |
path: ${{ env.NUGET_OUTPUT }} | |
- name: Configure NuGet | |
uses: nuget/setup-nuget@v1 | |
with: | |
nuget-version: ${{ env.NUGET_VERSION }} | |
- name: Push to NuGet Feed | |
shell: bash | |
working-directory: ${{ env.NUGET_OUTPUT }} | |
run: | | |
for nugetFile in ./*.nupkg | |
do | |
nuget push $nugetFile ${{ env.NUGET_TOKEN }} -Source ${{ env.NUGET_FEED }} | |
done |