You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2024/03/18 17:08:48 UTC

(arrow-adbc) branch main updated: chore: set up rest of C#/.NET release process (#1637)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new a34a10c29 chore: set up rest of C#/.NET release process (#1637)
a34a10c29 is described below

commit a34a10c2991e19c9da78864e7fa2a78de38930b7
Author: David Li <li...@gmail.com>
AuthorDate: Mon Mar 18 13:08:42 2024 -0400

    chore: set up rest of C#/.NET release process (#1637)
    
    Fixes #1121.
---
 .github/workflows/packaging.yml       |  3 +++
 csharp/Directory.Build.props          |  2 +-
 dev/release/post-07-csharp.sh         | 25 +++++++++++++++++++++++--
 dev/release/utils-prepare.sh          |  2 +-
 docs/source/development/releasing.rst | 19 +++++++++++++++++++
 5 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml
index 5126fb307..c6cde1e9a 100644
--- a/.github/workflows/packaging.yml
+++ b/.github/workflows/packaging.yml
@@ -938,6 +938,7 @@ jobs:
     runs-on: ubuntu-latest
     if: startsWith(github.ref, 'refs/tags/')
     needs:
+      - csharp
       - docs
       - source
       - java
@@ -961,6 +962,8 @@ jobs:
             '(' \
               -name docs.tgz -or \
               -name '*.jar' -or \
+              -name '*.nupkg' -or \
+              -name '*.snupkg' -or \
               -name '*.pom' -or \
               -name '*.whl' -or \
               -name 'adbc_*.tar.gz' -or \
diff --git a/csharp/Directory.Build.props b/csharp/Directory.Build.props
index 92ba53253..ff2671a72 100644
--- a/csharp/Directory.Build.props
+++ b/csharp/Directory.Build.props
@@ -29,7 +29,7 @@
     <Product>Apache Arrow ADBC library</Product>
     <Copyright>Copyright 2022-2023 The Apache Software Foundation</Copyright>
     <Company>The Apache Software Foundation</Company>
-    <Version>0.5.0</Version>
+    <Version>0.11.0</Version>
   </PropertyGroup>
 
   <PropertyGroup>
diff --git a/dev/release/post-07-csharp.sh b/dev/release/post-07-csharp.sh
old mode 100644
new mode 100755
index 2ea470201..11e66f384
--- a/dev/release/post-07-csharp.sh
+++ b/dev/release/post-07-csharp.sh
@@ -30,12 +30,26 @@ main() {
   fi
 
   local -r version="$1"
+  local -r tag="apache-arrow-adbc-${version}"
 
   if [ -z "${NUGET_API_KEY}" ]; then
     echo "NUGET_API_KEY is empty"
     exit 1
   fi
 
+  : ${REPOSITORY:="apache/arrow-adbc"}
+
+  local -r tmp=$(mktemp -d -t "arrow-post-csharp.XXXXX")
+
+  header "Downloading C# packages for ${version}"
+
+  gh release download \
+     --repo "${REPOSITORY}" \
+     "${tag}" \
+     --dir "${tmp}" \
+     --pattern "*.nupkg" \
+     --pattern "*.snupkg"
+
   local base_names=()
   base_names+=(Apache.Arrow.Adbc.${version})
   base_names+=(Apache.Arrow.Adbc.Client.${version})
@@ -44,14 +58,21 @@ main() {
   base_names+=(Apache.Arrow.Adbc.Drivers.Interop.Snowflake.${version})
   for base_name in "${base_names[@]}"; do
     dotnet nuget push \
-      ${base_name}.nupkg \
+      "${tmp}/${base_name}.nupkg" \
       -k ${NUGET_API_KEY} \
       -s https://api.nuget.org/v3/index.json
-    rm -f ${base_name}.{nupkg,snupkg}
   done
 
+  rm -rf "${tmp}"
+
   echo "Success! The released NuGet package is available here:"
   echo "  https://www.nuget.org/packages/Apache.Arrow.Adbc/${version}"
 }
 
+header() {
+    echo "============================================================"
+    echo "${1}"
+    echo "============================================================"
+}
+
 main "$@"
diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh
index 5eb08d81c..51ea9a523 100644
--- a/dev/release/utils-prepare.sh
+++ b/dev/release/utils-prepare.sh
@@ -52,7 +52,7 @@ update_versions() {
   git add meta.yaml
   popd
 
-  sed -i.bak -E "s/version = \".+\"/version = \"${version}\"/" "${ADBC_DIR}/csharp/Directory.Build.props"
+  sed -i.bak -E "s/<version>.+</version>/<version>${version}</version>/" "${ADBC_DIR}/csharp/Directory.Build.props"
   rm "${ADBC_DIR}/csharp/Directory.Build.props.bak"
   git add "${ADBC_DIR}/csharp/Directory.Build.props"
 
diff --git a/docs/source/development/releasing.rst b/docs/source/development/releasing.rst
index 3c8ebd3e1..b758c0d30 100644
--- a/docs/source/development/releasing.rst
+++ b/docs/source/development/releasing.rst
@@ -364,6 +364,25 @@ Be sure to go through on the following checklist:
       # dev/release/post-06-ruby.sh 1.0.0
       dev/release/post-06-ruby.sh <version>
 
+.. dropdown:: Upload C#/.NET packages to NuGet
+   :class-title: sd-fs-5
+   :class-container: sd-shadow-md
+
+   You must be one of owners of the package.  If you aren't an owner yet, an
+   existing owner can add you at https://nuget.org.
+
+   You will need to [create an API
+   key](https://learn.microsoft.com/en-us/nuget/nuget-org/publish-a-package#create-an-api-key).
+
+   An owner can upload:
+
+   .. code-block:: bash
+
+      export NUGET_API_KEY=<your API key here>
+
+      # dev/release/post-07-csharp.sh 1.0.0
+      dev/release/post-07-csharp.sh <version>
+
 .. dropdown:: Update conda-forge packages
    :class-title: sd-fs-5
    :class-container: sd-shadow-md