0.1.6 #7
Workflow file for this run
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 Package Deploy | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 'true' | |
steps: | |
- name: Setup .Net | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: | | |
7.0.x | |
8.0.x | |
- uses: actions/checkout@v4 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- run: | | |
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | |
echo "NuGetPreReleaseTagV2 (not used): ${{ steps.gitversion.outputs.CommitsSinceVersionSourcePadded }}" | |
- name: Restore with .Net | |
run: dotnet restore --nologo | |
- name: Build with .Net | |
run: dotnet build --configuration Release --no-restore --nologo "-p:Version=${{ steps.gitversion.outputs.MajorMinorPatch }}" | |
- name: Pack with .Net | |
run: | | |
dotnet pack --nologo --no-build --configuration Release --output nuget-packages -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} src/Apple.AppStoreConnect/Apple.AppStoreConnect.csproj | |
dotnet pack --nologo --no-build --configuration Release --output nuget-packages -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersionV2 }} src/Apple.AppStoreConnect.DependencyInjection/Apple.AppStoreConnect.DependencyInjection.csproj | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Nuget-packages-${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
path: nuget-packages | |
- name: Configure Github Nuget Feed | |
run: dotnet nuget add source --name github https://nuget.pkg.github.com/aviationexam/index.json | |
- name: Push package to Github Packages | |
run: dotnet nuget push 'nuget-packages/*.nupkg' --api-key ${{ secrets.GITHUB_TOKEN }} --source github | |
- name: Push package to Nuget | |
run: dotnet nuget push 'nuget-packages/*.nupkg' --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |