diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-10-05 15:46:50 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2020-10-07 12:27:58 +0300 |
commit | d6a7dbce2c4fe5abcf0765bf7620df4114521fd7 (patch) | |
tree | 98faecac8bcde651f8e664668dca4d5c78b6b485 /.github | |
parent | cacfb67f0ffdbd45aee612bf6e3eea82d2552162 (diff) |
Use .craft.ps1 wrapper
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/.craft.ps1 | 10 | ||||
-rw-r--r-- | .github/workflows/main.yml | 33 |
2 files changed, 24 insertions, 19 deletions
diff --git a/.github/workflows/.craft.ps1 b/.github/workflows/.craft.ps1 new file mode 100644 index 000000000..b1e5a31a9 --- /dev/null +++ b/.github/workflows/.craft.ps1 @@ -0,0 +1,10 @@ +if ($IsWindows) { + $python = (Get-Command py).Source +} else { + $python = (Get-Command python3).Source +} +$command = @("${env:HOME}/craft/CraftMaster/CraftMaster/CraftMaster.py", "--config", "${env:GITHUB_WORKSPACE}/.craft.ini", "--target", "${env:CRAFT_TARGET}", "--variables", "WORKSPACE=${env:HOME}/craft") + $args + +Write-Host "Exec: ${python} ${command}" + +& $python @command diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25791340e..9d9887a86 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,23 +25,18 @@ jobs: include: - target: windows-msvc2017_32-cl os: windows-latest - python: py fetch-depth: 1 - target: windows-msvc2017_64-cl os: windows-latest - python: py fetch-depth: 0 - target: macos-64-clang os: macos-latest - python: python3 fetch-depth: 1 - target: linux-64-gcc os: ubuntu-18.04 - python: python3 fetch-depth: 1 env: - CRAFT_MASTER: "`"$env:HOME/craft/CraftMaster/CraftMaster/CraftMaster.py`" --config `"${{ github.workspace }}/.craft.ini`" --target ${{ matrix.target }} --variables `"WORKSPACE=$env:HOME/craft`"" - CRAFT: "${{ matrix.python }} $env:CRAFT_MASTER -c" + CRAFT_TARGET: ${{ matrix.target }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} @@ -56,46 +51,46 @@ jobs: run: git clone --depth=1 https://invent.kde.org/kde/craftmaster.git "$env:HOME/craft/CraftMaster/CraftMaster" - name: Craft setup - run: Invoke-Expression ${{ matrix.python }} "$env:CRAFT_MASTER --setup" + run: ${{ github.workspace }}/.github/workflows/.craft.ps1 --setup - name: Craft unshelve - run: Invoke-Expression "$env:CRAFT --unshelve `"${{ github.workspace }}/.craft.shelf`" " + run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --unshelve "${{ github.workspace }}/.craft.shelf" - name: Prepare run: | if ($IsWindows) { - Invoke-Expression "$env:CRAFT dev-utils/nsis" + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c dev-utils/nsis } elseif($IsLinux) { sudo apt-get update -y sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libmtdev1 libgl1-mesa-dev libmtdev1 libinput-dev libxkbcommon0 libxcb-icccm4 libxcb-image0 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 libxcb-keysyms1 libxcb-xinerama0 libsm6 - Invoke-Expression "$env:CRAFT dev-utils/linuxdeploy" + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c dev-utils/linuxdeploy } - name: Install dependencies - run: Invoke-Expression "$env:CRAFT --install-deps owncloud/owncloud-client" + run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --install-deps owncloud/owncloud-client - name: Build run: | if ("${{ matrix.target }}" -eq "windows-msvc2017_64-cl") { - Invoke-Expression "$env:CRAFT --no-cache --src-dir `"${{ github.workspace }}`" --configure owncloud/owncloud-client" - $env:BUILD_DIR = $(Invoke-Expression "$env:CRAFT --get buildDir -q owncloud-client") - Invoke-Expression "$env:CRAFT --run pwsh `"${{ github.workspace }}/.github/workflows/.sonar.ps1`"" - Invoke-Expression "$env:CRAFT --no-cache --src-dir `"${{ github.workspace }}`" --install --qmerge owncloud/owncloud-client" + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --configure owncloud/owncloud-client + $env:BUILD_DIR = $(${{ github.workspace }}/.github/workflows/.craft.ps1 -c --get buildDir -q owncloud-client) + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --run pwsh "${{ github.workspace }}/.github/workflows/.sonar.ps1" + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --install --qmerge owncloud/owncloud-client } else { - Invoke-Expression "$env:CRAFT --no-cache --src-dir `"${{ github.workspace }}`" owncloud/owncloud-client" + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" owncloud/owncloud-client } - name: Run tests - run: Invoke-Expression "$env:CRAFT --no-cache --src-dir `"${{ github.workspace }}`" --test owncloud/owncloud-client" + run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --test owncloud/owncloud-client - name: Package - run: Invoke-Expression "$env:CRAFT --no-cache --src-dir `"${{ github.workspace }}`" --package owncloud/owncloud-client" + run: ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --no-cache --src-dir "${{ github.workspace }}" --package owncloud/owncloud-client - name: Prepare artifacts run: | New-Item -ItemType Directory "${{ github.workspace }}/binaries/" -ErrorAction SilentlyContinue Copy-Item "$env:HOME/craft/binaries/*" "${{ github.workspace }}/binaries/" - Invoke-Expression "$env:CRAFT --shelve `"${{ github.workspace }}/.craft.shelf`" " + ${{ github.workspace }}/.github/workflows/.craft.ps1 -c --shelve "${{ github.workspace }}/.craft.shelf" Copy-Item "${{ github.workspace }}/.craft.shelf" "${{ github.workspace }}/binaries/" - name: Upload artifacts |