Adding more comprehensive tests #169
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 and Publish | |
on: | |
pull_request: | |
push: | |
branches: [ main, 'releases/**' ] | |
release: | |
types: [ published ] | |
jobs: | |
pack: | |
name: Pack | |
env: | |
NUPKG_MAJOR: 0.999 | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Required Tools | |
uses: ./.github/workflows/setup-tools | |
- name: Package NuGets | |
shell: pwsh | |
run: | | |
$VERSION="$env:NUPKG_MAJOR-ci.$env:GITHUB_RUN_ID" | |
if ($env:GITHUB_EVENT_NAME -eq "release") { | |
$VERSION = $env:GITHUB_REF.Substring($env:GITHUB_REF.LastIndexOf('/') + 1) | |
} | |
echo "PACKAGE VERSION: $VERSION" | |
dotnet pack --output ./artifacts/nugets --configuration Release -p:PackageVersion=$VERSION /bl:./artifacts/logs/msbuild-pack.binlog | |
- name: Upload NuGet Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NuGet | |
path: ./artifacts/nugets | |
- name: Upload Logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: Pack Logs - Windows | |
path: ./artifacts/logs | |
publish: | |
name: Publish NuGet Packages | |
needs: pack | |
env: | |
NUGET_URL: 'https://pkgs.dev.azure.com/mattleibow/OpenSource/_packaging/test-device-runners/nuget/v3/index.json' | |
runs-on: windows-latest | |
if: github.event_name == 'release' | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: NuGet | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
source-url: ${{ env.NUGET_URL }} | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_NUGET_TOKEN }} | |
- name: Push NuGet | |
run: dotnet nuget push NuGet\*.nupkg --source $env:NUGET_URL --api-key AzureArtifacts |