From 6d651c72324dd45478136b4c42c70d96c480fa19 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Fri, 16 Feb 2024 08:36:55 +0000 Subject: [PATCH] [github] Update deprecated workflows --- .github/workflows/build.yml | 54 +++++++++++++++++++ .../sync-addon-metadata-translations.yml | 26 ++++++--- 2 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ec3077d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,54 @@ +name: Build and run tests +on: [push, pull_request] +env: + app_id: visualization.starburst + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: "Debian package test" + os: ubuntu-latest + CC: gcc + CXX: g++ + DEBIAN_BUILD: true + steps: + - name: Install needed ubuntu depends + env: + DEBIAN_BUILD: ${{ matrix.DEBIAN_BUILD }} + run: | + if [[ $DEBIAN_BUILD == true ]]; then sudo add-apt-repository -y ppa:team-xbmc/xbmc-nightly; fi + if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get update; fi + if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get install fakeroot; fi + - name: Checkout Kodi repo + uses: actions/checkout@v4 + with: + repository: xbmc/xbmc + ref: master + path: xbmc + - name: Checkout add-on repo + uses: actions/checkout@v4 + with: + path: ${{ env.app_id }} + - name: Configure + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + DEBIAN_BUILD: ${{ matrix.DEBIAN_BUILD }} + run: | + if [[ $DEBIAN_BUILD != true ]]; then cd ${app_id} && mkdir -p build && cd build; fi + if [[ $DEBIAN_BUILD != true ]]; then cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/xbmc/addons -DPACKAGE_ZIP=1 ${{ github.workspace }}/xbmc/cmake/addons; fi + if [[ $DEBIAN_BUILD == true ]]; then wget https://raw.githubusercontent.com/xbmc/xbmc/master/xbmc/addons/kodi-dev-kit/tools/debian-addon-package-test.sh && chmod +x ./debian-addon-package-test.sh; fi + if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get build-dep ${{ github.workspace }}/${app_id}; fi + - name: Build + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + DEBIAN_BUILD: ${{ matrix.DEBIAN_BUILD }} + run: | + if [[ $DEBIAN_BUILD != true ]]; then cd ${app_id}/build; fi + if [[ $DEBIAN_BUILD != true ]]; then make; fi + if [[ $DEBIAN_BUILD == true ]]; then ./debian-addon-package-test.sh ${{ github.workspace }}/${app_id}; fi diff --git a/.github/workflows/sync-addon-metadata-translations.yml b/.github/workflows/sync-addon-metadata-translations.yml index 496f92f..d0dc7df 100644 --- a/.github/workflows/sync-addon-metadata-translations.yml +++ b/.github/workflows/sync-addon-metadata-translations.yml @@ -2,9 +2,9 @@ name: Sync addon metadata translations on: push: - branches: [ Matrix, Nexus ] + branches: [ Matrix, Nexus, Omega ] paths: - - '**addon.xml' + - '**addon.xml.in' - '**resource.language.**strings.po' jobs: @@ -12,22 +12,34 @@ jobs: if: github.repository == 'xbmc/visualization.starburst' runs-on: ubuntu-latest + strategy: + + fail-fast: false + matrix: + python-version: [ 3.9 ] + steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: project - - name: Set up Python - uses: actions/setup-python@v2 + - name: Checkout sync_addon_metadata_translations repository + uses: actions/checkout@v4 + with: + repository: xbmc/sync_addon_metadata_translations + path: sync_addon_metadata_translations + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install git+https://github.com/xbmc/sync_addon_metadata_translations.git + python -m pip install sync_addon_metadata_translations/ - name: Run sync-addon-metadata-translations run: |