Skip to content

Commit

Permalink
Merge pull request #8 from oblivioncth/dev
Browse files Browse the repository at this point in the history
Merge to master for v0.1.4
  • Loading branch information
oblivioncth committed Feb 7, 2023
2 parents fd8a12b + ce5fa94 commit afe4355
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 208 deletions.
81 changes: 16 additions & 65 deletions .github/workflows/build-qi-qmp-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: Linux - Build QI-QMP
on:
workflow_call:
secrets:
qt_shared_url:
description: 'MEGA Qt shared install archive URL'
required: true
qt_static_url:
description: 'MEGA Qt static install archive URL'
qt_ffynnon_cred:
description: 'Credentials for getting Qt from Ffynnon'
required: true
outputs:
qt_shared_artifact_name:
Expand All @@ -18,7 +15,6 @@ on:
env:
general_download_dir: ${{ github.workspace }}/Download
qt_install_dir: ${{ github.workspace }}/Qt/Install
qt_download_dir: ${{ github.workspace }}/Qt/Download
qi_qmp_src_suffix: QI-QMP/Source
qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source
qi_qmp_build_dir: ${{ github.workspace }}/QI-QMP/Build
Expand All @@ -38,75 +34,29 @@ jobs:
qt_shared_artifact_name: ${{ steps.get_artifact_name.outputs.qt_shared_artifact_name }}
qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }}
steps:
- name: Set matrix derived variables
uses: kanga333/[email protected]
with:
key: ${{ matrix.qt_linkage }}
map: |
{
"shared": {
"qt_install_url": "${{ secrets.qt_shared_url }}",
"artifact_output_var": "qt_shared_artifact_name"
},
"static": {
"qt_install_url": "${{ secrets.qt_static_url }}",
"artifact_output_var": "qt_static_artifact_name"
}
}
export_to: env,log
- name: Set derived variables with shell because GitHub Actions env context sucks
run: |
echo "qi_qmp_package_path=${{ env.qi_qmp_build_dir }}/out/dist" >> $GITHUB_ENV
qi_qmp_install_path="${{ env.qi_qmp_build_dir }}/out/install"
echo "qi_qmp_install_path=$qi_qmp_install_path" >> $GITHUB_ENV
echo "qt_cmake=$qt_install_dir/bin/qt-cmake" >> $GITHUB_ENV
- name: Cache Qt Build
id: cache-qt
uses: actions/cache@v3
- name: Install Qt (custom build)
uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev
with:
version: 6.4.0
os: linux
compiler: clang
linkage: ${{ matrix.qt_linkage }}
path: ${{ env.qt_install_dir }}
key: ${{ env.qt_install_url }}
- name: Install megatools
if: steps.cache-qt.outputs.cache-hit != 'true'
env:
mt_build: megatools-1.11.0.20220519-linux-x86_64
mt_arch_ext: tar.gz
mt_repo: https://megatools.megous.com/builds/builds/
run: |
curl "$mt_repo/$mt_build.$mt_arch_ext" --output "$general_download_dir/$mt_build.$mt_arch_ext" --create-dirs --location --silent --show-error
cd $general_download_dir
tar xf "$mt_build.$mt_arch_ext"
cd "$mt_build"
cp -p megatools /usr/local/bin
- name: Create Qt Download Directory
if: steps.cache-qt.outputs.cache-hit != 'true'
run: mkdir -p "${{ env.qt_download_dir }}"
- name: Download Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: megatools dl "$qt_install_url" --path "${{ env.qt_download_dir }}"
- name: Determine Qt Install Package Name
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
qt_install_name=$(ls "${{ env.qt_download_dir }}" | grep "qt-.*7z")
echo "qt_install_dest=${{ env.qt_download_dir }}/$qt_install_name" >> $GITHUB_ENV
- name: Extract Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }}
credentials: ${{ secrets.qt_ffynnon_cred }}
- name: Install OpenGL lib
run: sudo apt-get install libglu1-mesa-dev
- name: Install XCB Related libs
run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev
- name: Install Doxygen
env:
doxy_build: doxygen-1.9.4
doxy_arch_ext: linux.bin.tar.gz
doxy_repo: https://www.doxygen.nl/files
run: |
curl "$doxy_repo/$doxy_build.$doxy_arch_ext" --output "$general_download_dir/$doxy_build.$doxy_arch_ext" --create-dirs --location --silent --show-error
cd $general_download_dir
tar xf "$doxy_build.$doxy_arch_ext"
cd "$doxy_build"
sudo make install
uses: oblivioncth/actions/ubuntu/install-doxygen-from-sourceforge@dev
with:
version: 1.9.5
- name: Install Graphviz
run: sudo apt-get install graphviz
- name: Install Ninja
Expand Down Expand Up @@ -141,12 +91,13 @@ jobs:
- name: Get QI-QMP artifact name
id: get_artifact_name
run: |
cpack_name=$(find * -type f -name "*.zip")
cpack_name=$(find "${{ env.qi_qmp_package_path }}" -type f -name "*.zip")
artifact_name=$(basename "$cpack_name" .zip)
echo "::set-output name=${{ env.artifact_output_var }}::$artifact_name"
echo "qi_qmp_current_artifact_name=$artifact_name" >> $GITHUB_ENV
echo "qt_${{ matrix.qt_linkage }}_artifact_name=$artifact_name" >> $GITHUB_OUTPUT
- name: Upload QI-QMP build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }}
name: ${{ env.qi_qmp_current_artifact_name }}
path: ${{ env.qi_qmp_install_path }}
if-no-files-found: error
63 changes: 15 additions & 48 deletions .github/workflows/build-qi-qmp-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: Windows - Build QI-QMP
on:
workflow_call:
secrets:
qt_shared_url:
description: 'MEGA Qt shared install archive URL'
required: true
qt_static_url:
description: 'MEGA Qt static install archive URL'
qt_ffynnon_cred:
description: 'Credentials for getting Qt from Ffynnon'
required: true
outputs:
qt_shared_artifact_name:
Expand All @@ -17,7 +14,6 @@ on:
value: ${{ jobs.build-qi-qmp.outputs.qt_static_artifact_name }}
env:
qt_install_dir: ${{ github.workspace }}/Qt/Install
qt_download_dir: ${{ github.workspace }}/Qt/Download
qi_qmp_src_suffix: QI-QMP/Source
qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source
qi_qmp_build_dir: ${{ github.workspace }}/QI-QMP/Build
Expand All @@ -36,51 +32,21 @@ jobs:
qt_shared_artifact_name: ${{ steps.get_artifact_name.outputs.qt_shared_artifact_name }}
qt_static_artifact_name: ${{ steps.get_artifact_name.outputs.qt_static_artifact_name }}
steps:
- name: Set matrix derived variables
uses: kanga333/[email protected]
with:
key: ${{ matrix.qt_linkage }}
map: |
{
"shared": {
"qt_install_url": "${{ secrets.qt_shared_url }}",
"artifact_output_var": "qt_shared_artifact_name"
},
"static": {
"qt_install_url": "${{ secrets.qt_static_url }}",
"artifact_output_var": "qt_static_artifact_name"
}
}
export_to: env,log
- name: Set derived variables with shell because GitHub Actions env context sucks
run: |
echo "qi_qmp_package_path=${{ env.qi_qmp_build_dir }}/out/dist" >> $Env:GITHUB_ENV
$qi_qmp_install_path="${{ env.qi_qmp_build_dir }}/out/install"
echo "qi_qmp_install_path=$qi_qmp_install_path" >> $Env:GITHUB_ENV
echo "qt_cmake=${Env:qt_install_dir}/bin/qt-cmake.bat" >> $Env:GITHUB_ENV
- name: Cache Qt Build
id: cache-qt
uses: actions/cache@v3
- name: Install Qt (custom build)
uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev
with:
version: 6.4.0
os: win32
compiler: msvc
linkage: ${{ matrix.qt_linkage }}
path: ${{ env.qt_install_dir }}
key: ${{ env.qt_install_url }}
- name: Install megatools
if: steps.cache-qt.outputs.cache-hit != 'true'
run: choco install megatools
- name: Create Qt Download Directory
if: steps.cache-qt.outputs.cache-hit != 'true'
run: New-Item -Path "${{ env.qt_download_dir }}" -ItemType "directory"
- name: Download Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: megatools dl "${Env:qt_install_url}" --path "${{ env.qt_download_dir }}"
- name: Determine Qt Install Package Name
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
$qt_install_name=(Get-ChildItem -Path "${{ env.qt_download_dir }}" -Name -Filter qt-*.7z)
echo "qt_install_dest=${{ env.qt_download_dir }}/${qt_install_name}" >> $Env:GITHUB_ENV
- name: Extract Qt Install
if: steps.cache-qt.outputs.cache-hit != 'true'
run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }}
credentials: ${{ secrets.qt_ffynnon_cred }}
- name: Install Doxygen & Graphviz
run: |
choco install doxygen.install --version 1.9.4
Expand All @@ -93,13 +59,11 @@ jobs:
- name: Build/Install QI-QMP
working-directory: ${{ env.qi_qmp_src_dir }}
shell: cmd
env:
doxygen_root: C:\Program Files\doxygen # Required because of #42
run: |
echo "Setup C++ Build Environment..."
CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64
echo "Configure CMake using Qt wrapper..."
CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.qi_qmp_src_dir}}" -B "${{ env.qi_qmp_build_dir }}" -D QI_QMP_DOCS_TARGET=ON -D Doxygen_ROOT="${{ env.doxygen_root }}"
CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.qi_qmp_src_dir}}" -B "${{ env.qi_qmp_build_dir }}" -D QI_QMP_DOCS_TARGET=ON"
echo "Changing to build directory..."
cd "%qi_qmp_build_dir%"
echo "Building QI-QMP debug..."
Expand All @@ -117,10 +81,13 @@ jobs:
echo "Build complete."
- name: Get QI-QMP artifact name
id: get_artifact_name
run: echo "::set-output name=${{ env.artifact_output_var }}::$((Get-ChildItem -Path "${{ env.qi_qmp_package_path }}" -Filter *.zip)[0].BaseName)"
run: |
$artifact_name=$((Get-ChildItem -Path "${{ env.qi_qmp_package_path }}" -Filter *.zip)[0].BaseName)
echo "qi_qmp_current_artifact_name=$artifact_name" >> $Env:GITHUB_ENV
echo "qt_${{ matrix.qt_linkage }}_artifact_name=$artifact_name" >> $Env:GITHUB_OUTPUT
- name: Upload QI-QMP build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }}
name: ${{ env.qi_qmp_current_artifact_name }}
path: ${{ env.qi_qmp_install_path }}
if-no-files-found: error
39 changes: 4 additions & 35 deletions .github/workflows/master-pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,9 @@ on:
branches: master

jobs:
ensure-higher-version:
name: Ensure higher version than last tag has been set
check-pr-correctness:
name: Master PR correctness check
runs-on: windows-latest
env:
qi_qmp_src_suffix: QI-QMP/Source/
qi_qmp_src_dir: ${{ github.workspace }}/QI-QMP/Source/
steps:
- name: Checkout QI-QMP
uses: actions/checkout@v3
with:
path: ${{ env.qi_qmp_src_suffix }}
fetch-depth: 0 # Required for tag search to find previous tag
- name: Compare versions
env:
match_start: set\(QI_QMP_BASE_VERSION
match_end: \)
run: |
cd "${{ env.qi_qmp_src_dir }}"
echo "Checking for version tags..."
if(git tag -l v*.*){
echo "Version tags found, comparing new and last tag..."
$last_tag_version = $(git describe --abbrev=0 --match v*.*).substring(1)
echo "Last tag version: ${last_tag_version}"
$project_lists = Get-Content -Raw CMakeLists.txt
if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){
throw "Could not get project version!"
}
$new_tag_version = $Matches[1].Trim()
echo "New tag version: ${new_tag_version}"
if(!([version]$new_tag_version -gt [version]$last_tag_version)){
throw "Project version was not increased to be above previous tagged version!"
}
}
else{
echo "No existing version tags present. Proceeding..."
}
- name: Ensure higher version
uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev
36 changes: 16 additions & 20 deletions .github/workflows/master-pull-request-merge-reaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,26 @@ jobs:
outputs:
version_tag: ${{ steps.tag_master.outputs.new_tag }}
steps:
- name: Checkout QI-QMP Master
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup git user for bot
run: |
git config --global user.name "${{ env.ci_bot_username }}"
git config --global user.email "${{ env.ci_bot_email }}"
- name: Get project version
id: get-proj-ver
uses: oblivioncth/actions/cmake/get-project-version@dev
- name: Set Git user to ObyBotCI
uses: oblivioncth/actions/git/set-git-user-to-oby-bot@dev
- name: Checkout Project
id: proj-checkout
uses: oblivioncth/actions/git/smart-checkout@dev
- name: Tag master with new version tag
id: tag_master
working-directory: ${{ steps.proj-checkout.outputs.path }}
env:
match_start: set\(QI_QMP_BASE_VERSION
match_end: \)
new_version: ${{ steps.get-proj-ver.outputs.version }}
run: |
$project_lists = Get-Content -Raw CMakeLists.txt
if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){
throw "Could not get base version!"
}
$new_tag = "v$($Matches[1].Trim())"
echo "::set-output name=new_tag::$new_tag"
$new_tag = "v${Env:new_version}"
echo "new_tag=$new_tag" >> $Env:GITHUB_OUTPUT
git tag -a $new_tag -m "Release $new_tag"
git push --tags
- name: Move 'latest' tag
working-directory: ${{ steps.proj-checkout.outputs.path }}
run: |
echo "Checking for 'latest' tag..."
if(git tag -l latest){
Expand All @@ -57,6 +54,7 @@ jobs:
git push origin latest
- name: Fast-forward merge master into to dev
if: always()
working-directory: ${{ steps.proj-checkout.outputs.path }}
run: |
git checkout dev
git merge master --ff-only
Expand All @@ -68,17 +66,15 @@ jobs:
if: github.event.pull_request.merged == true
uses: ./.github/workflows/build-qi-qmp-windows.yml
secrets:
qt_shared_url: ${{ secrets.QT_WINDOWS_SHARED_URL }}
qt_static_url: ${{ secrets.QT_WINDOWS_STATIC_URL }}
qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }}

build_qi_qmp_release_linux:
name: Build QI-QMP Release (Linux)
needs: tag_master_and_sync_dev
if: github.event.pull_request.merged == true
uses: ./.github/workflows/build-qi-qmp-linux.yml
secrets:
qt_shared_url: ${{ secrets.QT_LINUX_SHARED_URL }}
qt_static_url: ${{ secrets.QT_LINUX_STATIC_URL }}
qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }}

update-docs:
name: Update gh-pages
Expand Down
27 changes: 4 additions & 23 deletions .github/workflows/pull-request-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,9 @@ on:
types: [opened]

jobs:
label_master_pr:
name: Label master pull-request
if: github.base_ref == 'master'
label_pr:
name: Label pull-request
runs-on: ubuntu-latest
steps:
- name: Create label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: release-pr
label_other_pr:
name: Label other standard pull-requests
if: github.base_ref != 'master'
runs-on: ubuntu-latest
steps:
- name: Label bugfix PR
if: startsWith(github.head_ref, 'bugfix/')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: bug
- name: Label feature PR
if: startsWith(github.head_ref, 'feature/')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: enhancement

- name: Label via convention
uses: oblivioncth/actions/pull-request/label-pr-conventionally@dev
Loading

0 comments on commit afe4355

Please sign in to comment.