Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TypeError when using boost beta versions #29

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
boost_version: ['1.74.0', '1.80.0.beta1']

steps:
- uses: actions/checkout@v3
- name: Install boost
uses: ./
id: install-boost
with:
boost_version: 1.73.0
boost_version: ${{ matrix.boost_version }}
- name: List contents of boost directory
run: ls
working-directory: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The version of boost installed, e.g. `boost-1.73.0-linux-16.04`.
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.73.0
# OPTIONAL: Specify a custon install location
boost_install_dir: C:\some_directory
Expand All @@ -124,7 +124,7 @@ The version of boost installed, e.g. `boost-1.73.0-linux-16.04`.
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.73.0
# OPTIONAL: Specify a platform version
platform_version: 18.04
Expand All @@ -148,7 +148,7 @@ The version of boost installed, e.g. `boost-1.73.0-linux-16.04`.
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.73.0
# OPTIONAL: Specify a platform version
platform_version: 10.15
Expand Down Expand Up @@ -259,3 +259,4 @@ Due to memory restrictions on the build runners, there are some binaries which d
| windows-2022 | shared | mingw | x86 | ❌ |
| macos-10.15 | static+shared | clang | x86 | ✅ |
| macos-11 | static+shared | clang | x86 | ✅ |
| macos-12 | static+shared | clang | x86 | ✅ |
16 changes: 8 additions & 8 deletions dist/index.js

Large diffs are not rendered by default.

74 changes: 37 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "install-boost",
"version": "2.4.2",
"version": "2.4.3",
"description": "",
"main": "dist/index.js",
"private": true,
Expand Down Expand Up @@ -30,20 +30,20 @@
},
"homepage": "https://github.com/MarkusJx/install-boost#readme",
"dependencies": {
"@actions/cache": "^3.0.6",
"@actions/cache": "^3.1.0-beta.1",
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"request": "^2.88.2",
"request-progress": "^3.0.0",
"semver": "^7.3.8"
},
"devDependencies": {
"@types/node": "^18.11.9",
"@types/node": "^18.11.11",
"@types/request": "^2.48.8",
"@types/semver": "^7.3.13",
"@vercel/ncc": "^0.34.0",
"prettier": "^2.7.1",
"@vercel/ncc": "^0.36.0",
"prettier": "^2.8.1",
"rimraf": "^3.0.2",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
}
}
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,21 @@ async function main(): Promise<void> {
);
}

const semverReplace = (version: string) =>
version.replace(/([.\d]+)\.(beta|alpha)(\d+)/gi, '$1-$2.$3');

if (
!toolset &&
process.platform === 'win32' &&
(semver.gte(boost_version, '1.78.0') || script_version === 'legacy')
(semver.gte(semverReplace(boost_version), '1.78.0') ||
script_version === 'legacy')
) {
core.warning(
"The 'toolset' input is unset. This may lead to inconsistent build results."
);
} else if (
toolset &&
semver.lt(boost_version, '1.78.0') &&
semver.lt(semverReplace(boost_version), '1.78.0') &&
script_version !== 'legacy'
) {
core.warning(
Expand Down
9 changes: 3 additions & 6 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ export interface VersionRecord {

export type VersionsRecord = VersionRecord[];

/*export type VersionsRecord = Record<
string,
Record<string, string>[] | string
>[];*/

export function setOutputVariables(BOOST_ROOT: string, version: string): void {
core.startGroup('Set output variables');
console.log(`Setting BOOST_ROOT to '${BOOST_ROOT}'`);
Expand Down Expand Up @@ -135,7 +130,9 @@ export function parseArguments(
core.debug("File does not match param 'toolset'");
continue;
} else if (!toolset && file.toolset === 'mingw' && lastMatch) {
core.debug("'toolset' is unset but this toolset is 'mingw' and a better match was found");
core.debug(
"'toolset' is unset but this toolset is 'mingw' and a better match was found"
);
continue;
}

Expand Down