Compare commits

...

8 Commits

Author SHA1 Message Date
Alexei Lozovsky d8610e2b41 msvc-dev-cmd v1.10.0 2021-10-08 00:09:33 +09:00
Alexei Lozovsky 9f8ae839b0 Make npm audit happy (#50)
* Upgrade "ansi-regex" 5.0.0 => 5.0.1

And various other stuff because npm can't just upgrade one thing in the
lockfile, it need to upgrade everything it can. Move along, nothing
interesting to see here.

* Upgrade "eslint" 6 => 7

And also unpin the minor version. This resolves a bunch of "critical"
audit advisories from transitive dependencies.
2021-10-07 18:02:35 +03:00
Darrell Wright bb050e7771 Add support for VS2022 (#48)
Check $ProgramFiles too since that's where new stuff goes.
2021-10-07 17:45:10 +03:00
Amin Yahyaabadi f456b805b3 Export setupMSVCDevCmd to allow library usage (#47) 2021-09-16 03:11:51 +03:00
Alexei Lozovsky 74a501b087 Resolve audit warnings (#45)
* Update glob-parent to resolve CVE-2020-28469

* Run audit tasks on Ubuntu runners (they are cheaper)

* Audit only production dependencies

That is, something that can actually affect users of this action.
I don't really want to be bothered with yet another "prototype pollution"
or "denial of service" in transitive dependencies of eslint.

* Audit dev-dependencies for critical vulnerabilities

That said, still audit development dependencies for critical
vulnerabilities if they come along. Hopefully, this should be rare.
2021-06-09 12:25:52 +03:00
Alexei Lozovsky af5661e514 Add "x86-64" to the list of aliases too 2021-05-29 16:55:35 +03:00
Alexei Lozovsky 7defe92547 msvc-dev-cmd v1.9.0 2021-05-29 22:45:09 +09:00
Alexei Lozovsky e78ece9a2a Add "x86_64" and "x86-64" aliases for "x64" (#44)
By a popular request...
2021-05-29 16:43:24 +03:00
8 changed files with 1018 additions and 1114 deletions
+3 -2
View File
@@ -58,12 +58,13 @@ jobs:
dumpbin /headers hello.exe
audit:
name: npm audit
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
- run: npm install
- run: npm audit --audit-level=moderate
- run: npm audit --audit-level=moderate --production
- run: npm audit --audit-level=critical
alias-arch:
name: arch aliases
runs-on: windows-latest
+3 -2
View File
@@ -23,8 +23,9 @@ jobs:
hello.exe
audit:
name: npm audit
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
- run: npm audit --audit-level=moderate
- run: npm audit --audit-level=moderate --production
- run: npm audit --audit-level=critical
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
- `arch` target architecture
- native compilation:
- `x64` (default) or its synonyms: `amd64`, `win64`
- `x64` (default) or its synonyms: `amd64`, `win64`, `x86_64`, `x86-64`
- `x86` or its synonyms: `win32`
- cross-compilation: `x86_amd64`, `x86_arm`, `x86_arm64`, `amd64_x86`, `amd64_arm`, `amd64_arm64`
- `sdk` Windows SDK to use
+27 -15
View File
@@ -5,9 +5,11 @@ const path = require('path')
const process = require('process')
const PROGRAM_FILES_X86 = process.env['ProgramFiles(x86)']
const PROGRAM_FILES = [process.env['ProgramFiles(x86)'], process.env['ProgramFiles']]
const EDITIONS = ['Enterprise', 'Professional', 'Community']
const VERSIONS = ['2019', '2017']
const VERSIONS = ['2022', '2019', '2017']
const VSWHERE_PATH = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\Installer`
@@ -32,13 +34,15 @@ function findVcvarsall() {
// If that does not work, try the standard installation locations,
// starting with the latest and moving to the oldest.
for (const ver of VERSIONS) {
for (const ed of EDITIONS) {
path = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
core.info(`Trying standard location: ${path}`)
if (fs.existsSync(path)) {
core.info(`Found standard location: ${path}`)
return path
for (const prog_files of PROGRAM_FILES) {
for (const ver of VERSIONS) {
for (const ed of EDITIONS) {
path = `${prog_files}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
core.info(`Trying standard location: ${path}`)
if (fs.existsSync(path)) {
core.info(`Found standard location: ${path}`)
return path
}
}
}
}
@@ -70,7 +74,8 @@ function filterPathValue(path) {
return paths.filter(unique).join(';')
}
function main() {
/** See https://github.com/ilammy/msvc-dev-cmd#inputs */
function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre) {
if (process.platform != 'win32') {
core.info('This is not a Windows virtual environment, bye!')
return
@@ -79,17 +84,13 @@ function main() {
// Add standard location of "vswhere" to PATH, in case it's not there.
process.env.PATH += path.delimiter + VSWHERE_PATH
var arch = core.getInput('arch')
const sdk = core.getInput('sdk')
const toolset = core.getInput('toolset')
const uwp = core.getInput('uwp')
const spectre = core.getInput('spectre')
// There are all sorts of way the architectures are called. In addition to
// values supported by Microsoft Visual C++, recognize some common aliases.
let arch_aliases = {
"win32": "x86",
"win64": "x64",
"x86_64": "x64",
"x86-64": "x64",
}
// Ignore case when matching as that's what humans expect.
if (arch.toLowerCase() in arch_aliases) {
@@ -175,6 +176,17 @@ function main() {
core.info(`Configured Developer Command Prompt`)
}
exports.setupMSVCDevCmd = setupMSVCDevCmd
function main() {
var arch = core.getInput('arch')
const sdk = core.getInput('sdk')
const toolset = core.getInput('toolset')
const uwp = core.getInput('uwp')
const spectre = core.getInput('spectre')
setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre)
}
try {
main()
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "msvc-dev-cmd",
"version": "1.8.1",
"version": "1.10.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
+17 -46
View File
@@ -1,40 +1,16 @@
{
"_args": [
[
"@actions/core@1.2.6",
"/Users/ilammy/Documents/dev/ilammy/msvc-dev-cmd"
]
],
"_from": "@actions/core@1.2.6",
"_id": "@actions/core@1.2.6",
"_inBundle": false,
"_integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==",
"_location": "/@actions/core",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@actions/core@1.2.6",
"name": "@actions/core",
"escapedName": "@actions%2fcore",
"scope": "@actions",
"rawSpec": "1.2.6",
"saveSpec": null,
"fetchSpec": "1.2.6"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"_spec": "1.2.6",
"_where": "/Users/ilammy/Documents/dev/ilammy/msvc-dev-cmd",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"name": "@actions/core",
"version": "1.2.6",
"description": "Actions core lib",
"devDependencies": {
"@types/node": "^12.0.2"
},
"keywords": [
"github",
"actions",
"core"
],
"homepage": "https://github.com/actions/toolkit/tree/main/packages/core",
"license": "MIT",
"main": "lib/core.js",
"types": "lib/core.d.ts",
"directories": {
"lib": "lib",
"test": "__tests__"
@@ -43,15 +19,6 @@
"lib",
"!.DS_Store"
],
"homepage": "https://github.com/actions/toolkit/tree/main/packages/core",
"keywords": [
"github",
"actions",
"core"
],
"license": "MIT",
"main": "lib/core.js",
"name": "@actions/core",
"publishConfig": {
"access": "public"
},
@@ -65,6 +32,10 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"types": "lib/core.d.ts",
"version": "1.2.6"
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"devDependencies": {
"@types/node": "^12.0.2"
}
}
+964 -1045
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "msvc-dev-cmd",
"version": "1.8.1",
"version": "1.10.0",
"description": "GitHub Action to setup Developer Command Prompt for Microsoft Visual C++",
"main": "index.js",
"scripts": {
@@ -30,6 +30,6 @@
"@actions/core": "^1.2"
},
"devDependencies": {
"eslint": "^6.8.0"
"eslint": "^7"
}
}