diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3f895a3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Get version from tag + id: version + run: echo "value=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Restore + run: dotnet restore tests/ParquetBulkImporterTests/ParquetBulkImporterTests.csproj + + - name: Build + run: dotnet build src/ParquetBulkImporter/ParquetBulkImporter.csproj -c Release --no-restore + + - name: Test + run: dotnet test tests/ParquetBulkImporterTests/ParquetBulkImporterTests.csproj -c Release --no-build + + - name: Pack NuGet + run: | + dotnet pack src/ParquetBulkImporter/ParquetBulkImporter.csproj \ + -c Release \ + --no-build \ + -o ./artifacts \ + /p:Version=${{ steps.version.outputs.value }} \ + /p:PackageVersion=${{ steps.version.outputs.value }} + + - name: Upload package artifacts + uses: actions/upload-artifact@v4 + with: + name: nuget-packages-${{ github.ref_name }} + path: artifacts/* + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: | + artifacts/*.nupkg + artifacts/*.snupkg + generate_release_notes: true + + - name: Publish to NuGet.org + if: ${{ secrets.NUGET_API_KEY != '' }} + run: | + dotnet nuget push "artifacts/*.nupkg" \ + --source https://api.nuget.org/v3/index.json \ + --api-key "${{ secrets.NUGET_API_KEY }}" \ + --skip-duplicate diff --git a/README.md b/README.md index bf8e4f3..501300a 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,13 @@ python -m unittest discover -s tests/parquet_bulk_import_test -p "test_*.py" docker compose up -d ``` + +## Releases + +- Create a version tag like `v0.1.0` and push it to trigger the `Release` workflow. +- The workflow builds, tests, creates `.nupkg/.snupkg`, and publishes a GitHub Release. +- To also publish to NuGet.org, add repository secret `NUGET_API_KEY`. + ## Repository Layout - `src/ParquetBulkImporter`: library source diff --git a/src/ParquetBulkImporter/ParquetBulkImporter.csproj b/src/ParquetBulkImporter/ParquetBulkImporter.csproj index 4940e5e..dfedd77 100755 --- a/src/ParquetBulkImporter/ParquetBulkImporter.csproj +++ b/src/ParquetBulkImporter/ParquetBulkImporter.csproj @@ -1,19 +1,34 @@ - - - - net8.0 - enable - enable - false - false - false - x64 - - - - - - - - - + + + + net8.0 + enable + enable + + false + false + false + x64 + + false + ParquetBulkImporter + celoibarros + celoibarros + .NET 8 library for high-throughput Parquet to SQL Server bulk imports on Linux and Windows. + parquet;sql-server;bulk-import;etl;dotnet;csharp + MIT + https://github.com/celoibarros/parquet-bulk-import-sqlserver + https://github.com/celoibarros/parquet-bulk-import-sqlserver + git + true + true + snupkg + false + + + + + + + +