Update README.md #90
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: publish to nuget | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
name: build, pack & publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: run the version check and save result in environment var 'check_version_published' | |
run: | | |
echo "check package exists" | |
dotnet run --project .github/CheckVersionPublished/CheckVersionPublished.csproj Sharpi/Sharpi.csproj >> $GITHUB_ENV | |
- name: output environment variables | |
run: | | |
echo "${{ env.check_version_published }}" | |
echo "${{ env.version }}" | |
- name: check environment variable check_version_published, if 'no' then authenticate, build, pack, publish main project package | |
if: ${{ env.check_version_published == 'no'}} | |
run: | | |
echo "starting authenticate, build, pack; publish" | |
echo "authenticate for github" | |
dotnet nuget add source --username A-J-Bauer --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/A-J-Bauer/index.json" | |
echo "build and pack" | |
dotnet build Sharpi/Sharpi.csproj -o Sharpi/bin/ARM64 | |
echo "publish github" | |
dotnet nuget push "Sharpi/bin/ARM64/Sharpi.*.nupkg" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate -s "github" | |
echo "publish nuget" | |
dotnet nuget push "Sharpi/bin/ARM64/Sharpi.*.nupkg" -k ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json | |
- name: create release | |
if: ${{ env.check_version_published == 'no'}} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.version }} | |
release_name: ${{ env.version }} | |
draft: false | |
prerelease: false |