diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 95d5f23e..876ba7b6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,7 +14,7 @@ env: NETCORE_VERSION: '5.0.101' NUGET_SOURCE: 'https://api.nuget.org/v3/index.json' PROJECT_CONFIGURATION: Release - + PROJECT_PATH: ./src/PhoneNumbers/PhoneNumbers.csproj jobs: build: @@ -39,3 +39,18 @@ jobs: - name: dotnet test run: dotnet test --no-restore --verbosity normal + + - name: dotnet pack (pre-release) + if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' && github.ref == 'refs/heads/develop' + run: | + $date = Get-Date -Format "yyyyMMdd" + $projVersion = ([xml](Get-Content ${{ env.PROJECT_PATH }})) | Select-Xml -XPath "//Project/PropertyGroup[1]/Version" + dotnet pack --no-build --configuration ${{ env.PROJECT_CONFIGURATION }} -p:PackageVersion="$projVersion-preview$date.${{ github.run_id }}" + shell: pwsh + + - name: dotnet pack + if: matrix.os == 'ubuntu-latest' && github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + $projVersion = ([xml](Get-Content ${{ env.PROJECT_PATH }})) | Select-Xml -XPath "//Project/PropertyGroup[1]/Version" + dotnet pack --no-build --configuration ${{ env.PROJECT_CONFIGURATION }} -p:PackageVersion="$projVersion" + shell: pwsh