Pack preview source packages and publish them to nuget #3
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: Pack preview source packages and publish them to nuget | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
# --------------------------------------------- DotNet SDK | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4 | |
# --------------------------------------------- Android SDK | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'zulu' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
# --------------------------------------------- Workloads | |
- name: Install Workload | |
run: dotnet workload install maui-windows android wasm-tools wasi-experimental # ois and maui-ios are not supported in ubuntu machines https://github.com/dotnet/maui/issues/15929 | |
# --------------------------------------------- checkout repo | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: dotnet tool restore | |
- name: Install dependencies | |
run: dotnet restore src/build.sln | |
- name: define version suffix | |
run: echo "VERSIONSUFFIXSHORT=Prv-$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV | |
# - name: Test | |
# run: dotnet test -c Release --no-build | |
- name: Pack sources | |
run: dotnet PackAsSourcesNuget src/build.sln --output . --append-sources-suffix true --version-suffix ${{env.VERSIONSUFFIXSHORT}} | |
- name: Push to NuGet | |
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.InteropTypes_PublishToNuget}} --source https://api.nuget.org/v3/index.json |