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

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


The following commit(s) were added to refs/heads/main by this push:
     new 720b663  [CI] Fix tagger and bundler (#34)
720b663 is described below

commit 720b663cf46ea2a251b7796cea421e9c6f04febf
Author: Dewey Dunnington <[email protected]>
AuthorDate: Thu Aug 25 11:04:19 2022 -0300

    [CI] Fix tagger and bundler (#34)
    
    * maybe fix tagger and uploader
    
    * add token to workflow
    
    * maybe with the right permissions
    
    * with all write permissions
    
    * try uploading release using R
    
    * give up and just write to the gh-pages branch
    
    * use default permissions?
    
    * give up completely on automated zipping
    
    * commit to dist/ on main CI pass
    
    * tweak default build ID, add readme to dist
---
 .github/workflows/build-and-test.yaml | 22 ++++++++++++++++------
 .gitignore                            |  1 -
 CMakeLists.txt                        |  7 ++++++-
 dist/README.md                        | 23 +++++++++++++++++++++++
 4 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/build-and-test.yaml 
b/.github/workflows/build-and-test.yaml
index 2a52046..e594c03 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -110,7 +110,7 @@ jobs:
           sudo ldconfig
           mkdir build
           cd build
-          cmake .. -DCMAKE_BUILD_TYPE=Debug 
-DGTest_DIR=`pwd`/../dist/lib/cmake/GTest 
-DArrow_DIR=`pwd`/../dist/lib/cmake/arrow 
-DArrowTesting_DIR=`pwd`/../dist/lib/cmake/arrow -DNANOARROW_CODE_COVERAGE=ON 
-DNANOARROW_BUILD_TESTS=ON -DNANOARROW_BUILD_ID=${{ github.sha }}
+          cmake .. -DCMAKE_BUILD_TYPE=Debug 
-DGTest_DIR=`pwd`/../dist/lib/cmake/GTest 
-DArrow_DIR=`pwd`/../dist/lib/cmake/arrow 
-DArrowTesting_DIR=`pwd`/../dist/lib/cmake/arrow -DNANOARROW_CODE_COVERAGE=ON 
-DNANOARROW_BUILD_TESTS=ON
           cmake --build .
 
       - name: Build nanoarrow (bundled)
@@ -120,7 +120,7 @@ jobs:
           sudo ldconfig
           mkdir build
           cd build
-          cmake .. -DCMAKE_BUILD_TYPE=Debug 
-DGTest_DIR=`pwd`/../dist/lib/cmake/GTest 
-DArrow_DIR=`pwd`/../dist/lib/cmake/arrow 
-DArrowTesting_DIR=`pwd`/../dist/lib/cmake/arrow -DNANOARROW_CODE_COVERAGE=ON 
-DNANOARROW_BUILD_TESTS=ON -DNANOARROW_BUNDLE=ON -DNANOARROW_BUILD_ID=${{ 
github.sha }}
+          cmake .. -DCMAKE_BUILD_TYPE=Debug 
-DGTest_DIR=`pwd`/../dist/lib/cmake/GTest 
-DArrow_DIR=`pwd`/../dist/lib/cmake/arrow 
-DArrowTesting_DIR=`pwd`/../dist/lib/cmake/arrow -DNANOARROW_CODE_COVERAGE=ON 
-DNANOARROW_BUILD_TESTS=ON -DNANOARROW_BUNDLE=ON
           cmake --build .
 
       - name: Run tests
@@ -175,7 +175,7 @@ jobs:
       - name: Create bundle
         run: |
           mkdir build && cd build
-          cmake .. -DNANOARROW_BUNDLE=ON -DNANOARROW_BUILD_ID=${{ github.sha }}
+          cmake .. -DNANOARROW_BUNDLE=ON -DNANOARROW_BUILD_ID=gha${{ 
github.sha }}
           cmake --build .
           cmake --install . --prefix=../nanoarrow-latest
           cd ..
@@ -188,8 +188,18 @@ jobs:
           name: nanoarrow-latest
           path: nanoarrow-latest.zip
       
-      - name: Update latest tag reference
+      - name: Commit bundle to dist/
         if: success() && github.ref == 'refs/heads/main'
         run: |
-          git tag -f -a latest ${{ github.sha }}
-          git push -f origin refs/tags/latest
+          cp nanoarrow-latest/nanoarrow.h dist/nanoarrow.h
+          cp nanoarrow-latest/nanoarrow.c dist/nanoarrow.c
+          git add dist/nanoarrow.h dist/nanoarrow.c
+
+          # only commit if there are changes
+          git config --global user.email "[email protected]"
+          git config --global user.name "GitHub Actions"
+          UPDATED=`git diff --name-only --cached`
+          if [ "$UPDATED" ]; then
+            git commit -m "Update dist/ for commit ${{ github.sha }}"
+            git push
+          fi
diff --git a/.gitignore b/.gitignore
index f6c1673..ba72c6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,7 +16,6 @@
 # under the License.
 
 build
-dist
 arrow-hpp
 .DS_Store
 CMakeUserPresets.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f84486e..3ae6239 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,11 @@ project(NanoArrow)
 
 option(NANOARROW_BUILD_TESTS "Build tests" OFF)
 option(NANOARROW_BUNDLE "Create bundled nanoarrow.h and nanoarrow.c" OFF)
-option(NANOARROW_BUILD_ID "A string identifying this build" "devel")
+option(NANOARROW_BUILD_ID "A string identifying this build" OFF)
+
+if (NOT NANOARROW_BUILD_ID)
+    string(RANDOM LENGTH 10 NANOARROW_BUILD_ID)
+endif()
 
 option(NANOARROW_CODE_COVERAGE "Enable coverage reporting" OFF)
 add_library(coverage_config INTERFACE)
@@ -78,6 +82,7 @@ else()
 
     install(TARGETS nanoarrow DESTINATION lib)
     install(DIRECTORY src/ DESTINATION include FILES_MATCHING PATTERN "*.h")
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/build_id.h DESTINATION 
include/nanoarrow)
 endif()
 
 if(NANOARROW_BUILD_TESTS)
diff --git a/dist/README.md b/dist/README.md
new file mode 100644
index 0000000..c94e4fb
--- /dev/null
+++ b/dist/README.md
@@ -0,0 +1,23 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# Bundled header and source files
+
+These files are automatically generated from the latest commit (that
+passes CI on the main branch).

Reply via email to