Sc 97669/update qtwebdriver to use GitHub workflows #17
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: CI | |
on: | |
pull_request: | |
branches: [WD_1.X_dev] | |
paths-ignore: | |
- '**/*.md' | |
push: | |
tags: | |
- v* | |
env: | |
QTVERSION: 5.15.8-lts-lgpl | |
jobs: | |
tar-src: | |
outputs: | |
short_version: ${{ steps.config.outputs.short_version }} | |
name: "Tar source" | |
runs-on: ubuntu-latest | |
steps: | |
- id: config | |
run: | | |
echo "artefact_name=qtwebdriver-${QTVERSION}-src.tar.gz" >> $GITHUB_OUTPUT | |
echo "short_version=${QTVERSION}" >> $GITHUB_OUTPUT | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
path: qtwebdriver-src | |
- name: Archive | |
run: tar --create --xz --file "${{ steps.config.outputs.artefact_name }}" --exclude-vcs qtwebdriver-src | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ steps.config.outputs.artefact_name }}" | |
path: "${{ github.workspace }}/${{ steps.config.outputs.artefact_name }}" | |
build: | |
name: "Build ${{ matrix.config.os }}" | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- os: "ubuntu-22.04" | |
std: "17" | |
steps: | |
- id: config | |
run: echo "artefact_name=qtwebdriver-${QTVERSION}-cpp${{ matrix.config.std }}-${{ matrix.config.os }}-x64.tar.gz" >> $GITHUB_OUTPUT | |
- name: Install dependencies | |
run: | | |
sudo apt-get -o Acquire::Retries=3 update | |
sudo apt-get -o Acquire::Retries=3 install -y \ | |
gyp \ | |
libegl1-mesa-dev \ | |
libglib2.0-dev \ | |
libgstreamer1.0-dev \ | |
libgstreamer-plugins-base1.0-dev \ | |
libhyphen-dev \ | |
libicu-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libunwind-dev \ | |
libxslt1-dev \ | |
- name: Install Qt | |
run: curl -L https://github.com/constructpm/qt-build/releases/download/v5.15.8-lts-lgpl-1/qt-5.15.8-lts-lgpl-cpp17-${{ matrix.config.os }}-x64.tar.gz | sudo tar -xJC /opt | |
- name: Install Qtwebkit | |
run: curl -L https://github.com/constructpm/qtwebkit-build/releases/download/v5.212.0-1/qtwebkit-d1c854e-cpp17-${{ matrix.config.os }}-x64.tar.gz | sudo tar xvJ -C /opt | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
working-directory: ${{ github.workspace }} | |
run: ./build.sh | |
- name: Archive | |
working-directory: ${{ github.workspace }} | |
run: | | |
mv out qtwebdriver | |
tar cJfv "${{ steps.config.outputs.artefact_name }}" qtwebdriver | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "${{ steps.config.outputs.artefact_name }}" | |
path: "${{ github.workspace }}/${{ steps.config.outputs.artefact_name }}" | |
release: | |
if: contains(github.ref, 'tags/v') | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: | |
- tar-src | |
- build | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
upload: | |
if: contains(github.ref, 'tags/v') | |
name: "Upload ${{ matrix.config.artefact }} to release" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- artefact: qtwebdriver-${{ needs.tar-src.outputs.short_version }}-src.tar.gz | |
- artefact: qtwebdriver-${{ needs.tar-src.outputs.short_version }}-cpp17-ubuntu-22.04-x64.tar.gz | |
needs: | |
- tar-src | |
- release | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: "${{ matrix.config.artefact }}" | |
path: ./ | |
- name: Upload to Release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: "./${{ matrix.config.artefact }}" | |
asset_name: "${{ matrix.config.artefact }}" | |
asset_content_type: application/x-gtar |