Treat empty _in arrays as false, ie. #194
This file contains hidden or 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: [ main ] | |
| paths: | |
| - "src/**" | |
| - ".github/workflows/nuget-package-publish.yml" | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - "src/**" | |
| - ".github/workflows/nuget-package-publish.yml" | |
| workflow_dispatch: | |
| env: | |
| API_KEY: ${{ secrets.NUGET_PACKAGES_GITHUB_API_KEY }} | |
| CSPROJ_PATH: src/BccCode.Linq/BccCode.Linq.csproj | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 8.0.* | |
| - name: Set Environment Variables | |
| uses: ./.github/actions/setvars | |
| with: | |
| varFilePath: ./.github/variables/version.env | |
| - name: Set package version | |
| run: | | |
| if [[ $GITHUB_REF == 'refs/heads/main' && $GITHUB_EVENT_NAME == 'push' ]]; then | |
| echo "VERSION=${{ env.NUGET_PACKAGE_VERSION_BASE }}.${{ github.run_number}}" >> "$GITHUB_ENV" | |
| else | |
| echo "VERSION=${{ env.NUGET_PACKAGE_VERSION_BASE }}.${{ github.run_number}}-beta" >> "$GITHUB_ENV" | |
| fi | |
| - name: Run Tests | |
| run: dotnet test | |
| - name: Package | |
| run: dotnet pack -p:PackageVersion=${{ env.VERSION }} -c Release -o . ${{ env.CSPROJ_PATH }} | |
| - name: Publish | |
| if: env.API_KEY != '' | |
| run: dotnet nuget push *.nupkg -k "${{ env.API_KEY }}" -s https://api.nuget.org/v3/index.json --skip-duplicate |