You've already forked setup-msbuild
mirror of
https://github.com/microsoft/setup-msbuild.git
synced 2026-03-16 22:03:17 +07:00
Compare commits
10 Commits
v1.3
...
timheuer/n
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53bd3e099e | ||
|
|
4031508ab2 | ||
|
|
dfc05ccabb | ||
|
|
f62e96d728 | ||
|
|
c77b6bc497 | ||
|
|
767f00a3f0 | ||
|
|
442baebb59 | ||
|
|
70b70342ae | ||
|
|
31e0ba28c7 | ||
|
|
6fb0222098 |
104
.github/workflows/test.yml
vendored
104
.github/workflows/test.yml
vendored
@@ -4,66 +4,76 @@ on:
|
||||
branches:
|
||||
- dev
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- "*.md"
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- "*.md"
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- dev
|
||||
- arm64
|
||||
- master
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
runner:
|
||||
- windows-latest
|
||||
- windows-2025-vs2026
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup MSBuild (vswhere-path)
|
||||
id: setup_msbuild_explicit
|
||||
uses: ./
|
||||
with:
|
||||
vswhere-path: C:\ProgramData\chocolatey\bin
|
||||
- name: Setup MSBuild (vswhere-path)
|
||||
id: setup_msbuild_explicit
|
||||
uses: ./
|
||||
with:
|
||||
vswhere-path: C:\ProgramData\chocolatey\bin
|
||||
|
||||
- name: Setup MSBuild (PATH)
|
||||
id: setup_msbuild_path
|
||||
uses: ./
|
||||
- name: Setup MSBuild (PATH)
|
||||
id: setup_msbuild_path
|
||||
uses: ./
|
||||
|
||||
- name: Setup MSBuild (fallback)
|
||||
id: setup_msbuild_fallback
|
||||
uses: ./
|
||||
env:
|
||||
PATH: ''
|
||||
- name: Setup MSBuild (fallback)
|
||||
id: setup_msbuild_fallback
|
||||
uses: ./
|
||||
env:
|
||||
PATH: ""
|
||||
|
||||
- name: Setup MSBuild (x64)
|
||||
if: always()
|
||||
id: setup_msbuild_path_x64
|
||||
uses: ./
|
||||
with:
|
||||
vs-prerelease: true
|
||||
msbuild-architecture: 'x64'
|
||||
- name: Setup MSBuild (x64)
|
||||
if: runner.arch == 'X64'
|
||||
id: setup_msbuild_path_x64
|
||||
uses: ./
|
||||
with:
|
||||
vs-prerelease: true
|
||||
msbuild-architecture: "x64"
|
||||
|
||||
- name: Setup MSBuild (arm64)
|
||||
if: always()
|
||||
id: setup_msbuild_path_arm
|
||||
uses: ./
|
||||
with:
|
||||
vs-prerelease: true
|
||||
msbuild-architecture: 'arm64'
|
||||
- name: Setup MSBuild (arm64)
|
||||
if: runner.arch == 'ARM64'
|
||||
id: setup_msbuild_path_arm64
|
||||
uses: ./
|
||||
with:
|
||||
vs-prerelease: true
|
||||
msbuild-architecture: "arm64"
|
||||
|
||||
- name: echo msbuild path
|
||||
run: |
|
||||
echo "vswhere-path: ${{ steps.setup_msbuild_explicit.outputs.msbuildPath }}"
|
||||
echo "PATH: ${{ steps.setup_msbuild_path.outputs.msbuildPath }}"
|
||||
echo "ARM PATH: ${{ steps.setup_msbuild_path_arm.outputs.msbuildPath }}"
|
||||
echo "ARM PATH: ${{ steps.setup_msbuild_path_x64.outputs.msbuildPath }}"
|
||||
echo "Fallback: ${{ steps.setup_msbuild_fallback.outputs.msbuildPath }}"
|
||||
- name: Write MSBuild summary
|
||||
if: always()
|
||||
shell: pwsh
|
||||
run: |
|
||||
@"
|
||||
## MSBuild setup summary
|
||||
|
||||
- name: echo MSBuild
|
||||
run: msbuild -version
|
||||
- Runner label: `${{ matrix.runner }}`
|
||||
- Runner architecture: `${{ runner.arch }}`
|
||||
|
||||
| Probe | msbuildPath |
|
||||
| --- | --- |
|
||||
| vswhere-path | ${{ steps.setup_msbuild_explicit.outputs.msbuildPath || 'N/A' }} |
|
||||
| PATH | ${{ steps.setup_msbuild_path.outputs.msbuildPath || 'N/A' }} |
|
||||
| Fallback | ${{ steps.setup_msbuild_fallback.outputs.msbuildPath || 'N/A' }} |
|
||||
| x64 | ${{ steps.setup_msbuild_path_x64.outputs.msbuildPath || 'N/A' }} |
|
||||
| arm64 | ${{ steps.setup_msbuild_path_arm64.outputs.msbuildPath || 'N/A' }} |
|
||||
"@ | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
|
||||
|
||||
- name: echo MSBuild
|
||||
run: msbuild -version
|
||||
|
||||
13
README.md
13
README.md
@@ -2,13 +2,14 @@
|
||||
|
||||
This action will help discover where the `MSBuild` tool is and automatically add it to the `PATH` environment variables for you so future steps in your Actions workflow can just initiate `msbuild` commands without knowing the full path.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Please note this tool does NOT add other Visual Studio tools (like VSTest, cl, cmake, or others) to `PATH`
|
||||
|
||||
## Example Usage
|
||||
|
||||
```yml
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
|
||||
- name: Build app for release
|
||||
run: msbuild src\YourProjectFile.csproj -t:rebuild -verbosity:diag -property:Configuration=Release
|
||||
@@ -16,7 +17,7 @@ This action will help discover where the `MSBuild` tool is and automatically add
|
||||
|
||||
## Runners and included software
|
||||
|
||||
This action is intended to be used within the GitHub Actions workflows using the model of 'runners' either hosted (provided by GitHub) or self-hosted (provided by you). The version and parameters you specify below are going to be scoped to what software actually exists on the runner image being used. For example, hosted runner images from GitHub typically do NOT have pre-release versions of Visual Studio on them so using `vs-prerelease` parameter noted below may not have intended effect when using hosted runners. The software included for GitHub-hosted runner iamges can always be found here: <https://github.com/actions/runner-images> which also includes information on when/how software on hosted images gets updated.
|
||||
This action is intended to be used within the GitHub Actions workflows using the model of 'runners' either hosted (provided by GitHub) or self-hosted (provided by you). The version and parameters you specify below are going to be scoped to what software actually exists on the runner image being used. For example, hosted runner images from GitHub typically do NOT have pre-release versions of Visual Studio on them so using `vs-prerelease` parameter noted below may not have intended effect when using hosted runners. The software included for GitHub-hosted runner images can always be found here: <https://github.com/actions/runner-images> which also includes information on when/how software on hosted images gets updated.
|
||||
|
||||
## Optional Parameters
|
||||
|
||||
@@ -28,7 +29,7 @@ You may have a situation where your Actions runner has multiple versions of Visu
|
||||
|
||||
```yml
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
with:
|
||||
vs-version: '[16.4,16.5)'
|
||||
```
|
||||
@@ -41,7 +42,7 @@ If you need your Actions runner to target a pre-release version of Visual Studio
|
||||
|
||||
```yml
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
with:
|
||||
vs-prerelease: true
|
||||
```
|
||||
@@ -52,7 +53,7 @@ By default the action will use the x86 architecture for MSBuild, but it is possi
|
||||
|
||||
```yml
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
with:
|
||||
msbuild-architecture: x64
|
||||
```
|
||||
@@ -63,7 +64,7 @@ This makes use of the vswhere tool which is a tool delivered by Microsoft to hel
|
||||
|
||||
```yml
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
with:
|
||||
vswhere-path: 'C:\path\to\your\tools\'
|
||||
```
|
||||
|
||||
@@ -23,5 +23,5 @@ outputs:
|
||||
description: "The resulting location of msbuild for your inputs"
|
||||
|
||||
runs:
|
||||
using: "node16"
|
||||
using: "node24"
|
||||
main: "dist/index.js"
|
||||
|
||||
6284
dist/index.js
vendored
6284
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
24
package-lock.json
generated
24
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "setup-msbuild",
|
||||
"version": "1.3.2",
|
||||
"version": "3.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "setup-msbuild",
|
||||
"version": "1.3.2",
|
||||
"version": "3.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
@@ -17,7 +17,7 @@
|
||||
"@types/jest": "^24.0.23",
|
||||
"@types/node": "^12.12.25",
|
||||
"@typescript-eslint/parser": "^2.8.0",
|
||||
"@zeit/ncc": "^0.20.5",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-github": "^2.0.0",
|
||||
"eslint-plugin-jest": "^22.21.0",
|
||||
@@ -789,12 +789,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@zeit/ncc": {
|
||||
"version": "0.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.20.5.tgz",
|
||||
"integrity": "sha512-XU6uzwvv95DqxciQx+aOLhbyBx/13ky+RK1y88Age9Du3BlA4mMPCy13BGjayOrrumOzlq1XV3SD/BWiZENXlw==",
|
||||
"deprecated": "@zeit/ncc is no longer maintained. Please use @vercel/ncc instead.",
|
||||
"node_modules/@vercel/ncc": {
|
||||
"version": "0.38.4",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
|
||||
"integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"ncc": "dist/ncc/cli.js"
|
||||
}
|
||||
@@ -8845,10 +8845,10 @@
|
||||
"tsutils": "^3.17.1"
|
||||
}
|
||||
},
|
||||
"@zeit/ncc": {
|
||||
"version": "0.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.20.5.tgz",
|
||||
"integrity": "sha512-XU6uzwvv95DqxciQx+aOLhbyBx/13ky+RK1y88Age9Du3BlA4mMPCy13BGjayOrrumOzlq1XV3SD/BWiZENXlw==",
|
||||
"@vercel/ncc": {
|
||||
"version": "0.38.4",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
|
||||
"integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"abab": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-msbuild",
|
||||
"version": "1.3.2",
|
||||
"version": "3.0.0",
|
||||
"private": true,
|
||||
"description": "Helps set up specific MSBuild tool into PATH for later usage.",
|
||||
"main": "lib/main.js",
|
||||
@@ -9,7 +9,7 @@
|
||||
"format": "prettier --write **/*.ts",
|
||||
"format-check": "prettier --check **/*.ts",
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"pack": "ncc build",
|
||||
"pack": "ncc build lib/main.js -o dist",
|
||||
"test": "jest",
|
||||
"all": "npm run build && npm run format && npm run lint && npm run pack"
|
||||
},
|
||||
@@ -36,7 +36,7 @@
|
||||
"@types/jest": "^24.0.23",
|
||||
"@types/node": "^12.12.25",
|
||||
"@typescript-eslint/parser": "^2.8.0",
|
||||
"@zeit/ncc": "^0.20.5",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-github": "^2.0.0",
|
||||
"eslint-plugin-jest": "^22.21.0",
|
||||
|
||||
Reference in New Issue
Block a user