fix(ci): Pin r-lib actions as a workaround for latest action updates #1226
Workflow file for this run
This file contains 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
# 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. | |
name: packaging | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'apache-arrow-nanoarrow-*-rc*' | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
source: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Prepare version | |
shell: bash | |
run: | | |
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then | |
VERSION=${GITHUB_REF_NAME#apache-arrow-nanoarrow-} | |
VERSION=${VERSION%-rc*} | |
else | |
VERSION=$(grep 'set(NANOARROW_VERSION' CMakeLists.txt | \ | |
grep -E -o '[0-9]+\.[0-9]+\.[0-9]+') | |
description=$(git describe \ | |
--always \ | |
--dirty \ | |
--long \ | |
--match "apache-arrow-nanoarrow-[0-9]*.*" \ | |
--tags) | |
case "${description}" in | |
# apache-arrow-nanoarrow-0.1.0-10-1234567-dirty | |
apache-arrow-nanoarrow-*) | |
# 10-1234567-dirty | |
distance="${description#apache-arrow-nanoarrow-*.*.*-}" | |
# 10-1234567 | |
distance="${distance%-dirty}" | |
# 10 | |
distance="${distance%-*}" | |
;; | |
*) | |
distance=$(git log --format=oneline | wc -l) | |
;; | |
esac | |
VERSION="${VERSION}.dev${distance}" | |
fi | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Create archive | |
shell: bash | |
run: | | |
dev/release/source_build.sh \ | |
apache-arrow-nanoarrow-${VERSION} \ | |
$(git log -n 1 --format=%h) | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: source | |
retention-days: 7 | |
path: | | |
apache-arrow-nanoarrow-${{ env.VERSION }}.tar.gz | |
docs: | |
runs-on: ubuntu-latest | |
needs: | |
- source | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: source | |
- name: Extract source archive | |
run: | | |
source_archive=$(echo apache-arrow-nanoarrow-*.tar.gz) | |
VERSION=${source_archive#apache-arrow-nanoarrow-} | |
VERSION=${VERSION%.tar.gz} | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
tar xf apache-arrow-nanoarrow-${VERSION}.tar.gz | |
mv apache-arrow-nanoarrow-${VERSION} nanoarrow | |
- name: Build documentation | |
run: | | |
echo "::group::Docker Pull" | |
cd nanoarrow | |
docker compose run --rm -e GITHUB_ACTIONS docs | |
echo "::endgroup::" | |
- name: Compress docs | |
run: | | |
cp -R nanoarrow/docs/_build/html nanoarrow-docs | |
tar -czf docs.tgz nanoarrow-docs | |
- name: Upload docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
retention-days: 2 | |
path: | | |
docs.tgz | |
update-asf-site: | |
runs-on: ubuntu-latest | |
needs: | |
- docs | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
- name: Clone asf-site branch | |
uses: actions/checkout@v4 | |
with: | |
ref: asf-site | |
path: pages-clone | |
- name: Update development documentation | |
env: | |
DOC_TAG: "main" | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
cd pages-clone | |
if [ -d "$DOC_TAG" ]; then | |
git rm -rf "$DOC_TAG" | |
fi | |
tar -xf ../docs.tgz | |
mv nanoarrow-docs "$DOC_TAG" | |
git add * | |
git commit --allow-empty -m"update documentation for tag $DOC_TAG" | |
- name: Push development documentation to asf-site | |
if: success() && github.repository == 'apache/arrow-nanoarrow' && github.ref == 'refs/heads/main' | |
run: | | |
cd pages-clone | |
git push | |
create-release: | |
runs-on: ubuntu-latest | |
needs: | |
- docs | |
- source | |
permissions: | |
contents: write | |
steps: | |
- name: Get all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: release-artifacts | |
- name: List release artifacts | |
run: | | |
find release-artifacts -type f | |
- name: Create release | |
if: success() && startsWith(github.ref, 'refs/tags/') | |
run: | | |
RELEASE_TAG=${GITHUB_REF#refs/*/} | |
UPLOAD=$(find release-artifacts -type f) | |
gh release create "${RELEASE_TAG}" \ | |
--repo ${{ github.repository }} \ | |
--prerelease \ | |
--title "nanoarrow ${RELEASE_TAG}" \ | |
${UPLOAD} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |