diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 31b76cca..3b353edd 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -25,11 +25,11 @@ jobs: example-modules: qtsensors steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 cache: npm cache-dependency-path: action/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21c692d6..2e65c95c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,11 +6,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 cache: npm cache-dependency-path: action/ @@ -51,6 +51,7 @@ jobs: # In Qt 6.2.0+, qtwebengine requires qtpositioning and qtwebchannel modules: qtwebengine qtpositioning qtwebchannel - tools-only-build: true + add-tools-to-path: true cache: - cached - uncached @@ -81,14 +82,18 @@ jobs: version: "5.15.2" requested: "5.15" modules: qtwebengine + - os: ubuntu-22.04 + qt: + tools-only-build: true + add-tools-to-path: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 cache: npm cache-dependency-path: action/ @@ -189,19 +194,34 @@ jobs: with: tools-only: true tools: tools_ifw tools_qtcreator,qt.tools.qtcreator + add-tools-to-path: ${{ matrix.qt.add-tools-to-path }} cache: ${{ matrix.cache == 'cached' }} - name: Test installed tools - if: ${{ matrix.qt.tools-only-build }} - env: - # Conditionally set qtcreator path based on os: - QTCREATOR_BIN_PATH: ${{ startsWith(matrix.os, 'macos') && '../Qt/Qt Creator.app/Contents/MacOS/' || '../Qt/Tools/QtCreator/bin/' }} + if: ${{ matrix.qt.tools-only-build && matrix.qt.add-tools-to-path }} shell: bash run: | + echo "Path: ${PATH}" # Check if QtIFW is installed - ls ../Qt/Tools/QtInstallerFramework/*/bin/ - ../Qt/Tools/QtInstallerFramework/*/bin/archivegen --version + which archivegen + archivegen --version # Check if QtCreator is installed: QtCreator includes the CLI program 'qbs' on all 3 platforms - ls "${QTCREATOR_BIN_PATH}" - "${QTCREATOR_BIN_PATH}qbs" --version + which qbs + qbs --version + + - name: Test that installed tools are not in the path + if: ${{ matrix.qt.tools-only-build && !matrix.qt.add-tools-to-path }} + shell: bash + run: | + echo "Path: ${PATH}" + # Check that QtIFW has been installed + ls ../Qt/Tools/QtInstallerFramework/*/bin/ | grep archivegen + + # Check that QtIFW is not in the path + ! which archivegen + ! archivegen --version + + # Check that qbs (from QtCreator) is not in the path + ! which qbs + ! qbs --version diff --git a/README.md b/README.md index 71698b41..ebb8d7ed 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,22 @@ For example, this value will install the most recent versions of QtIFW and QtCre You can find a full list of tools easily by using [this awesome website](https://ddalcino.github.io/aqt-list-server/). +### `add-tools-to-path` + +When set to `true`, and the `tools` parameter is non-empty, +the following paths will be prepended to the `PATH` variable: +* `Tools/**/bin` +* `*.app/Contents/MacOS` +* `*.app/**/bin` + +Most tools end up in the `Tools` folder, and have a `bin` directory containing CLI tools. +On MacOS, several tools are packaged in `.app` bundles, and CLI tools are spread out among various `bin` folders +and the `Contents/MacOS` folder. + +Distinct from, and not affected by, the `set-env` parameter. + +Default: `true` + ### `source` Set this to `true` to install Qt source code. Incompatible with `aqtinstall < 2.0.4`. @@ -200,6 +216,7 @@ Default: none ### `set-env` Set this to false if you want to avoid setting environment variables for whatever reason. +Has no effect on `tools` paths; to modify these you must use `add-tools-to-path`. Default: `true` @@ -261,6 +278,10 @@ Example value: `--external 7z` ## More info For more in-depth and certifiably up-to-date documentation, check the documentation for aqtinstall [here](https://aqtinstall.readthedocs.io/en/latest/getting_started.html). +Any tools you installed with the `tools` key will be added to the beginning of your `PATH` environment variable. +Specifically, any `bin` directories within the tool's directory will be added. +On MacOS, if the tool is an app bundle, then the `.app/Contents/MacOS` folder will also be added to your `PATH`. + The Qt bin directory is appended to your `path` environment variable. `Qt5_DIR` is also set appropriately for CMake if you are using Qt 5. In addition, `QT_PLUGIN_PATH`, `QML2_IMPORT_PATH`, `PKG_CONFIG_PATH` and `LD_LIBRARY_PATH` are set accordingly. `IQTA_TOOLS` is set to the "Tools" directory if tools are installed as well. diff --git a/README_upgrade_guide.md b/README_upgrade_guide.md index 537b9f11..66e8f56e 100644 --- a/README_upgrade_guide.md +++ b/README_upgrade_guide.md @@ -15,6 +15,14 @@ If your action uses this variable for any other purpose, you should update it to use `QT_ROOT_DIR` instead. * Removed the `Qt5_Dir` and `Qt6_DIR` environment variables, because they are not used by CMake. If your action uses these variables, you should update them to use `QT_ROOT_DIR` instead. +* Any tools you installed with the `tools` key will be added to the beginning of your `PATH` environment variable. + Specifically, any `bin` directories within the tool's directory will be added. + On MacOS, if the tool is an app bundle, then the `.app/Contents/MacOS` folder will also be added to your `PATH`. + * You should take care to investigate the order of the new `PATH` variable to make sure that the tools you are using + are not clobbered by tools in some other path. You may need to rearrange the order of your workflow steps, so that + any clobbered tools are added to the path later than the ones added by this action. + * If the added tool paths are still causing trouble, you can remove them from the `PATH` by setting + `add-tools-to-path: false`. ## v3 * Updated `aqtinstall` to version 2.1.* by default. diff --git a/action.yml b/action.yml index 543685f6..f14c8a6a 100644 --- a/action.yml +++ b/action.yml @@ -39,6 +39,9 @@ inputs: -- specify comma-separated argument lists which are themselves separated by spaces: ,, + add-tools-to-path: + default: true + description: When true, prepends directories of tools to PATH environment variable. set-env: default: true description: Whether or not to set environment variables after running aqtinstall @@ -80,7 +83,7 @@ runs: steps: - name: Setup Python if: ${{ inputs.setup-python == 'true' }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.6.x - 3.11.x' @@ -98,6 +101,7 @@ runs: cache: ${{ inputs.cache }} cache-key-prefix: ${{ inputs.cache-key-prefix }} tools: ${{ inputs.tools }} + add-tools-to-path: ${{ inputs.add-tools-to-path }} set-env: ${{ inputs.set-env }} no-qt-binaries: ${{ inputs.no-qt-binaries }} tools-only: ${{ inputs.tools-only }} diff --git a/action/action.yml b/action/action.yml index 7e2d2852..334d0075 100644 --- a/action/action.yml +++ b/action/action.yml @@ -36,6 +36,9 @@ inputs: -- specify comma-separated argument lists which are themselves separated by spaces: ,, + add-tools-to-path: + default: true + description: When true, prepends directories of tools to PATH environment variable. set-env: default: true description: Whether or not to set environment variables after running aqtinstall @@ -73,5 +76,5 @@ inputs: example-modules: description: Space-separated list of additional example modules to install. runs: - using: node16 + using: node20 main: lib/main.js diff --git a/action/package-lock.json b/action/package-lock.json index 04c74877..bdeeaee9 100644 --- a/action/package-lock.json +++ b/action/package-lock.json @@ -260,15 +260,14 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/@azure/ms-rest-js": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", - "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", + "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", "dependencies": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", "form-data": "^2.5.0", "node-fetch": "^2.6.7", - "tough-cookie": "^3.0.1", "tslib": "^1.10.0", "tunnel": "0.0.6", "uuid": "^8.3.2", @@ -496,9 +495,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -621,9 +620,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1465,14 +1464,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==", - "engines": { - "node": ">=4" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1817,15 +1808,11 @@ "node": ">= 0.6.0" } }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, "engines": { "node": ">=6" } @@ -1925,9 +1912,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -2016,19 +2003,6 @@ "node": ">=8.0" } }, - "node_modules/tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "dependencies": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -2153,9 +2127,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -2423,15 +2397,14 @@ } }, "@azure/ms-rest-js": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", - "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", + "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", "requires": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", "form-data": "^2.5.0", "node-fetch": "^2.6.7", - "tough-cookie": "^3.0.1", "tslib": "^1.10.0", "tunnel": "0.0.6", "uuid": "^8.3.2", @@ -2618,9 +2591,9 @@ }, "dependencies": { "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -2683,9 +2656,9 @@ }, "dependencies": { "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -3305,11 +3278,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ip-regex": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha512-58yWmlHpp7VYfcdTwMTvwMmqx/Elfxjd9RXTDyMsbL7lLWmhMylLEqiYVLKuLzOZqVgiWXD9MfR62Vv89VRxkw==" - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3553,15 +3521,11 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" }, - "psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "queue-microtask": { "version": "1.2.3", @@ -3611,9 +3575,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, "shebang-command": { "version": "2.0.0", @@ -3675,16 +3639,6 @@ "is-number": "^7.0.0" } }, - "tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "requires": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -3774,9 +3728,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrappy": { diff --git a/action/src/main.ts b/action/src/main.ts index ff27a5ea..1d2bcb9b 100644 --- a/action/src/main.ts +++ b/action/src/main.ts @@ -25,6 +25,11 @@ const setOrAppendEnvVar = (name: string, value: string): void => { core.exportVariable(name, newValue); }; +const toolsPaths = (installDir: string): string[] => + ["Tools/**/bin", "*.app/Contents/MacOS", "*.app/**/bin"].flatMap((p: string): string[] => + glob.sync(`${installDir}/${p}`) + ); + const pythonCommand = (command: string, args: readonly string[]): string => { const python = process.platform === "win32" ? "python" : "python3"; return `${python} -m ${command} ${args.join(" ")}`; @@ -83,6 +88,7 @@ class Inputs { readonly modules: string[]; readonly archives: string[]; readonly tools: string[]; + readonly addToolsToPath: boolean; readonly extra: string[]; readonly src: boolean; @@ -184,6 +190,8 @@ class Inputs { (tool: string): string => tool.replace(/,/g, " ") ); + this.addToolsToPath = Inputs.getBoolInput("add-tools-to-path"); + this.extra = Inputs.getStringArrayInput("extra"); const installDeps = core.getInput("install-deps").toLowerCase(); @@ -300,9 +308,16 @@ const run = async (): Promise => { "libxkbcommon-dev", "libxkbcommon-x11-0", "libxcb-xkb-dev", - ].join(" "); + ]; + + // Qt 6.5.0 adds this requirement: + // https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.5.0/release-note.md + if (compareVersions(inputs.version, ">=", "6.5.0")) { + dependencies.push("libxcb-cursor0"); + } + const updateCommand = "apt-get update"; - const installCommand = `apt-get install ${dependencies} -y`; + const installCommand = `apt-get install ${dependencies.join(" ")} -y`; if (inputs.installDeps === "nosudo") { await exec(updateCommand); await exec(installCommand); @@ -402,6 +417,11 @@ const run = async (): Promise => { core.info(`Automatic cache saved with id ${cacheId}`); } + // Add tools to path + if (inputs.addToolsToPath && inputs.tools.length) { + toolsPaths(inputs.dir).map(nativePath).forEach(core.addPath); + } + // Set environment variables if (inputs.setEnv) { if (inputs.tools.length) { @@ -425,6 +445,8 @@ const run = async (): Promise => { core.addPath(nativePath(`${qtPath}/bin`)); } } + // Expose outputs + core.setOutput("qtPath", qtPath); } catch (error) { if (error instanceof Error) { core.setFailed(error); diff --git a/action/tsconfig.json b/action/tsconfig.json index 9ecff867..7342096e 100644 --- a/action/tsconfig.json +++ b/action/tsconfig.json @@ -20,6 +20,7 @@ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + "lib": ["ES2019"], /* Strict Type-Checking Options */ "strict": true, /* Enable all strict type-checking options. */