ci: drop centos stream 8 #237
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
name: build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
LD_LIBRARY_PATH: /usr/local/opt/curl/lib:$LD_LIBRARY_PATH | |
PYCURL_SSL_LIBRARY: openssl | |
GEN_DOC_DIR: html | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: centos-stream-9 | |
shortcut: c9s | |
container-name: el9stream | |
name: ${{ matrix.name }} | |
env: | |
ARTIFACTS_DIR: exported-artifacts | |
container: | |
image: quay.io/ovirt/buildcontainer:${{ matrix.container-name }} | |
steps: | |
- name: Prepare build environment | |
run: | | |
# Install oVirt repositories | |
dnf copr enable -y ovirt/ovirt-master-snapshot centos-stream-9 | |
dnf install -y ovirt-release-master | |
- name: Install required packages | |
run: | | |
dnf install \ | |
createrepo_c \ | |
dnf-utils \ | |
gcc \ | |
git \ | |
gzip \ | |
openssl-devel \ | |
libcurl-devel \ | |
libxml2-devel \ | |
libxslt-devel \ | |
python3-devel \ | |
python3-nose \ | |
python3-pip \ | |
python3-pycodestyle \ | |
python3-pycurl \ | |
python3-pygments \ | |
python3-pyflakes \ | |
python3-six \ | |
python3-wheel \ | |
rpm-build \ | |
tar \ | |
-y | |
- name: Checkout sources | |
uses: ovirt/checkout-action@main | |
- name: Run build for version | |
run: | | |
.automation/build-rpm.sh $ARTIFACTS_DIR | |
- name: Create DNF repository | |
run: | | |
createrepo_c $ARTIFACTS_DIR | |
- name: Upload RPM artifacts | |
uses: ovirt/upload-rpms-action@main | |
with: | |
directory: ${{ env.ARTIFACTS_DIR }} | |
- name: Checkout target repository | |
if: ${{ matrix.shortcut == 'c9s' }} | |
uses: actions/checkout@v4 | |
with: | |
path: ovirt-engine-sdk | |
ref: 'gh-pages' | |
generate_documentation: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install Dependencies | |
# This step installs dependencies for python-sdk and pdoc | |
run: | | |
sudo apt update && | |
sudo apt install -y git \ | |
python2 \ | |
python2-dev \ | |
curl \ | |
asciidoctor \ | |
gcc \ | |
libxml2-dev \ | |
libcurl4-openssl-dev \ | |
libexpat1-dev \ | |
gettext \ | |
libz-dev \ | |
libssl-dev \ | |
libgnutls28-dev | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install pip2.7 | |
# This step installs pip2.7, which will be needed later | |
run: | | |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py | |
python2 get-pip.py | |
- name: Install Python-SDK with Python 2.7 | |
# This step installs the python-sdk with python2.7, as the extension of pdoc, | |
# which is subsequently installed, doesn't have python3 support. | |
run: | | |
pip2.7 install setuptools | |
bash .automation/generate-setup-files.sh | |
python2.7 setup.py install --user --prefix= | |
shell: bash | |
- name: Install Pdoc | |
# This steps installs an extension of pdoc which supports asciidoc | |
# (this extension runs on python2). | |
run: | | |
git clone https://github.com/machacekondra/pdoc | |
cd pdoc | |
pip2.7 install -U . | |
- name: Install pygments | |
run: pip2.7 install pygments | |
- name: Generate documentation | |
run: pdoc ovirtsdk4 --html --html-dir=html | |
- name: Upload generated documentation artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: generated-documentation | |
path: ${{ env.GEN_DOC_DIR }}/* | |
publish-doc: | |
permissions: | |
contents: write | |
needs: generate_documentation | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/centos/centos:stream9 | |
steps: | |
- name: Download generated documentation artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: generated-documentation | |
path: ${{ env.GEN_DOC_DIR }} | |
- name: Install package dependencies | |
run: | | |
dnf install \ | |
git \ | |
python3-devel \ | |
python3-pip \ | |
-y | |
- name: Set git defaults | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Checkout target repository | |
uses: actions/checkout@v4 | |
with: | |
path: ovirt-engine-sdk | |
ref: 'gh-pages' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set FOLDER variable according to pushed branch | |
run: | | |
IFS="/" read _ type value <<< ${GITHUB_REF} | |
if [[ ${type} == "heads" ]]; | |
then | |
if [[ ${value} == "main" ]] | |
then | |
echo "FOLDER=master" >> $GITHUB_ENV; | |
else | |
echo "FOLDER=${value: -3}" >> $GITHUB_ENV; | |
fi | |
elif [[ ${type} == "tags" ]] | |
then | |
echo "FOLDER=${value:0:3}" >> $GITHUB_ENV; | |
fi | |
- name: Move created documentation to gh-pages | |
run: | | |
mkdir -p ./ovirt-engine-sdk/${{env.FOLDER}}/ | |
cp ./html/ovirtsdk4/* ./ovirt-engine-sdk/${{env.FOLDER}}/ | |
- name: Push changes to gh-pages | |
run: | | |
cd ovirt-engine-sdk | |
commit=$(git log --format="%H" -n 1) | |
description=$(git describe --always) | |
if git status --porcelain 2>/dev/null| grep -E "^??|^M" | |
then | |
git add . | |
git commit -m "gh-pages ${description} ${commit}" | |
git push | |
fi |