@@ -54,11 +54,11 @@ jobs:
5454 dotnet : ['8.0.x']
5555 steps :
5656 - name : Install C#
57- uses : actions/setup-dotnet@v4.2 .0
57+ uses : actions/setup-dotnet@v4.3 .0
5858 with :
5959 dotnet-version : ${{ matrix.dotnet }}
6060 - name : Setup Python
61- uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
61+ uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4 .0
6262 with :
6363 python-version : 3
6464 - name : Checkout Arrow
8686 dotnet : ['8.0.x']
8787 steps :
8888 - name : Install C#
89- uses : actions/setup-dotnet@v4.2 .0
89+ uses : actions/setup-dotnet@v4.3 .0
9090 with :
9191 dotnet-version : ${{ matrix.dotnet }}
9292 - name : Checkout Arrow
@@ -113,11 +113,11 @@ jobs:
113113 dotnet : ['8.0.x']
114114 steps :
115115 - name : Install C#
116- uses : actions/setup-dotnet@v4.2 .0
116+ uses : actions/setup-dotnet@v4.3 .0
117117 with :
118118 dotnet-version : ${{ matrix.dotnet }}
119119 - name : Setup Python
120- uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3 .0
120+ uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4 .0
121121 with :
122122 python-version : 3.12
123123 - name : Checkout Arrow
@@ -133,3 +133,88 @@ jobs:
133133 - name : Test
134134 shell : bash
135135 run : ci/scripts/csharp_test.sh $(pwd)
136+
137+ package :
138+ name : Package
139+ # Branch or RC tag
140+ if : github.ref_type != 'tag' || contains(github.ref_name, 'rc')
141+ runs-on : ubuntu-latest
142+ timeout-minutes : 15
143+ permissions :
144+ contents : write
145+ steps :
146+ - name : Checkout for utilities
147+ if : github.ref_type == 'tag'
148+ uses : actions/checkout@v4
149+ with :
150+ path : arrow
151+ - name : Download source archive
152+ if : github.ref_type == 'tag'
153+ run : |
154+ arrow/dev/release/utils-watch-gh-workflow.sh \
155+ ${GITHUB_REF_NAME} \
156+ release_candidate.yml
157+ gh release download ${GITHUB_REF_NAME} \
158+ --pattern "*.tar.gz" \
159+ --repo ${GITHUB_REPOSITORY}
160+ tar -xf *.tar.gz --strip-components=1
161+ mv csharp/dummy.git .git
162+ env :
163+ GH_TOKEN : ${{ github.token }}
164+ - name : Checkout
165+ if : github.ref_type != 'tag'
166+ uses : actions/checkout@v4
167+ with :
168+ fetch-depth : 0
169+ - name : Prepare version
170+ if : github.ref_type != 'tag'
171+ run : |
172+ # apache-arrow-20.0.0.dev-9-g758867f907 ->
173+ # 20.0.0.dev-9-g758867f907 ->
174+ # 20.0.0.dev-9 ->
175+ # 20.0.0-dev-9
176+ semver="$(git describe --tags | \
177+ sed -E \
178+ -e 's/^apache-arrow-//' \
179+ -e 's/-[^-]*$//' \
180+ -e 's/^([0-9]*\.[0-9]*\.[0-9])\./\1-/')"
181+ sed -i'' -E -e \
182+ "s/^ <Version>.+<\/Version>/ <Version>${semver}<\/Version>/" \
183+ csharp/Directory.Build.props
184+ - name : Setup Python
185+ uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
186+ with :
187+ python-version : 3
188+ - name : Setup Archery
189+ run : |
190+ python3 -m pip install -e 'dev/archery[docker]'
191+ - name : Build
192+ run : |
193+ archery docker run ubuntu-csharp
194+ - name : Prepare artifacts
195+ run : |
196+ shopt -s globstar
197+ cp csharp/artifacts/**/*.{,s}nupkg ./
198+ for artifact in *.{,s}nupkg; do
199+ dev/release/utils-generate-checksum.sh "${artifact}"
200+ done
201+ - name : Upload
202+ uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
203+ with :
204+ name : nuget
205+ path : |
206+ *.nupkg
207+ *.sha256
208+ *.sha512
209+ *.snupkg
210+ - name : Publish
211+ if : github.ref_type == 'tag'
212+ run : |
213+ gh release upload ${GITHUB_REF_NAME} \
214+ --repo ${GITHUB_REPOSITORY} \
215+ *.nupkg \
216+ *.sha256 \
217+ *.sha512 \
218+ *.snupkg
219+ env :
220+ GH_TOKEN : ${{ github.token }}
0 commit comments