Bump actions/checkout from 3 to 4 #53
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
# Copyright 2022 Sutou Kouhei <[email protected]> | |
# | |
# Licensed 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: Document | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Prepare | |
run: | | |
sudo apt update | |
sudo apt install -y -V \ | |
ca-certificates \ | |
lsb-release \ | |
wget | |
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
sudo apt install -y -V \ | |
./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
sudo apt update | |
sudo apt install -y -V \ | |
doxygen \ | |
gtk-doc-tools \ | |
libarrow-glib-dev \ | |
libgirepository1.0-dev \ | |
ninja-build \ | |
valac | |
pip install -r requirements.txt | |
case ${GITHUB_REF} in | |
refs/tags/*) | |
version=${GITHUB_REF#refs/tags/} | |
;; | |
*) | |
version=main | |
;; | |
esac | |
echo "VERSION=${version}" >> ${GITHUB_ENV} | |
- uses: actions-rs/toolchain@v1 | |
id: rust-toolchain | |
with: | |
override: true | |
toolchain: stable | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo | |
key: cargo-doc-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install cargo-c | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: cargo-c | |
- name: Generate | |
run: | | |
meson setup \ | |
--libdir=lib \ | |
--prefix=${HOME}/local \ | |
-Ddoc=true \ | |
-Dsource-reference=${VERSION} \ | |
-Dvapi=true \ | |
-Dwerror=true \ | |
build \ | |
. | |
ninja -C build doc/html | |
cp -a build/doc/html/ ./ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: html | |
path: html/ | |
- uses: actions/checkout@v4 | |
if: | | |
startsWith(github.ref, 'refs/tags/') || | |
github.ref == 'refs/heads/main' | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Deploy | |
if: | | |
startsWith(github.ref, 'refs/tags/') || | |
github.ref == 'refs/heads/main' | |
run: | | |
rm -rf gh-pages/${VERSION} | |
cp -a build/doc/html/ gh-pages/${VERSION} | |
if [ "${VERSION}" != "main" ]; then | |
rm -rf gh-pages/latest | |
cp -a gh-pages/${VERSION} gh-pages/latest | |
fi | |
cd gh-pages | |
if [ "$(git status --porcelain)" != "" ]; then | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add --all | |
git commit -m "Update by ${GITHUB_SHA}" | |
git push origin gh-pages | |
fi | |
doc_dir=gh-pages/${VERSION} |