ci release: upload release source, packages, or documents #62
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
name: Build document | |
on: | |
push: | |
paths: | |
- 'Rakefile' | |
- 'doc/**' | |
- 'include/**/*.h' | |
- 'include/**/*.hpp' | |
- '.github/workflows/document.yml' | |
pull_request: | |
paths: | |
- 'Rakefile' | |
- 'doc/**' | |
- 'include/**/*.h' | |
- 'include/**/*.hpp' | |
- '.github/workflows/document.yml' | |
concurrency: | |
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build the full document | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ruby | |
- name: Prepare ccache | |
run: | | |
echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV} | |
- name: Cache ccache | |
uses: actions/cache@v4 | |
with: | |
path: ccache | |
key: document-linux-ccache-${{ hashFiles('lib/**', 'src/**', 'plugins/**', 'include/**') }} | |
restore-keys: document-linux-ccache- | |
- name: Install dependencies | |
run: | | |
./setup.sh | |
pip install -r doc/requirements.txt | |
(cd doc && bundle install) | |
- name: Build document | |
run: | | |
ccache --show-stats --verbose --version || : | |
cmake -S . -B /tmp/groonga.build --preset=doc | |
mkdir -p /tmp/groonga.org/ja | |
rake release:document:update BUILD_DIR=/tmp/groonga.build GROONGA_ORG_DIR=/tmp/groonga.org | |
ccache --show-stats --verbose --version || : | |
- name: Create archive | |
run: | | |
version=$(cat base_version) | |
mv /tmp/groonga.org /tmp/document-${version} | |
tar -czf document-${version}.tar.gz -C /tmp/ document-${version} | |
# Artifact | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: document | |
path: document-*.tar.gz | |
release: | |
if: | | |
github.ref_type == 'tag' | |
needs: build | |
uses: ./.github/workflows/release.yml | |
with: | |
tag: ${{ github.ref_name }} | |
secrets: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# todo: Documents generated by Doxygen are also built with CMake. | |
doxygen: | |
name: Doxygen | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ruby | |
- name: Install Doxygen | |
run: sudo apt install -y -V doxygen graphviz | |
- name: Run Doxygen | |
run: rake document:api |