Skip to content

Commit e8c71f6

Browse files
committed
Add x86 MASM support, but x64 still default
1 parent 08ac7e4 commit e8c71f6

File tree

9 files changed

+354
-56
lines changed

9 files changed

+354
-56
lines changed

.github/workflows/ci.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,37 @@ jobs:
1717
runs-on: windows-latest
1818
strategy:
1919
matrix:
20+
platform: [x86, x64]
2021
toolchain:
2122
- stable
2223
steps:
2324
- uses: actions/checkout@v4
24-
- uses: microsoft/setup-msbuild@v1.1
25+
- uses: microsoft/setup-msbuild@v2
26+
with:
27+
msbuild-architecture: ${{matrix.platform}}
2528
- uses: ./
29+
with:
30+
vs-architecture: ${{matrix.platform}}
2631
- name: Check MASM Path
2732
run: |
28-
$ml64Path = Get-Command ml64.exe -ErrorAction SilentlyContinue
29-
if ($ml64Path) {
30-
Write-Output "ml64.exe found in PATH: $($ml64Path.Source)"
33+
if ("${{matrix.platform}}" -eq "x64") {
34+
$ml64Path = Get-Command ml64.exe -ErrorAction SilentlyContinue
35+
if ($ml64Path) {
36+
Write-Output "ml64.exe found in PATH: $($ml64Path.Source)"
37+
} else {
38+
Write-Error "ml64.exe not found in PATH."
39+
exit 1
40+
}
41+
} elseif ("${{matrix.platform}}" -eq "x86") {
42+
$mlPath = Get-Command ml.exe -ErrorAction SilentlyContinue
43+
if ($mlPath) {
44+
Write-Output "ml.exe found in PATH: $($mlPath.Source)"
45+
} else {
46+
Write-Error "ml.exe not found in PATH."
47+
exit 1
48+
}
3149
} else {
32-
Write-Error "ml64.exe not found in PATH."
50+
Write-Error "Unknown platform ${{matrix.platform}} to get ml<XXX>.exe in PATH."
3351
exit 1
3452
}
53+

.gitignore

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Dependency directory
2+
node_modules
3+
4+
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
jspm_packages/
46+
47+
# TypeScript v1 declaration files
48+
typings/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variables file
69+
.env
70+
.env.test
71+
72+
# parcel-bundler cache (https://parceljs.org/)
73+
.cache
74+
75+
# next.js build output
76+
.next
77+
78+
# nuxt.js build output
79+
.nuxt
80+
81+
# vuepress build output
82+
.vuepress/dist
83+
84+
# Serverless directories
85+
.serverless/
86+
87+
# FuseBox cache
88+
.fusebox/
89+
90+
# DynamoDB Local files
91+
.dynamodb/
92+
93+
# OS metadata
94+
.DS_Store
95+
Thumbs.db
96+
97+
# Ignore built ts files
98+
dist/main.js

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# setup-masm [![Build Status](https://github.com/glslang/setup-masm/actions/workflows/ci.yaml/badge.svg)](https://github.com/glslang/setup-masm/actions) [![GitHub release](https://img.shields.io/github/v/release/glslang/setup-masm?logo=github)](https://github.com/marketplace/actions/setup-masm)
22

3-
A GitHub Action to facilitate configuring MASM (Microsoft Macro Assembler) in the workflow PATH to use x64 assembly in Win32 applications.
3+
A GitHub Action to facilitate configuring MASM (Microsoft Macro Assembler) in the workflow PATH to use x86 or x64 assembly in Win32 applications.
44

55
## Description
66

@@ -16,8 +16,9 @@ Add the following step to your workflow:
1616
1717
## Inputs
1818
19-
- `vs-version`: The version of Visual Studio to use. Defaults to 'latest'.
20-
- `vs-prerelease`: Whether to include prerelease versions of Visual Studio. Defaults to 'false'.
19+
- `vs-version`: The version of Visual Studio to use. Defaults to `'latest'`.
20+
- `vs-prerelease`: Whether to include prerelease versions of Visual Studio. Defaults to `'false'`.
21+
- `vs-architecture`: By default the action will use the x64 architecture for MASM, but it is possible to target the x86 versions instead. Valid input values are `'x64'` and `'x86'`. Note that the success of these will rely on the runner OS. Defaults to `'x64'`.
2122

2223
## Outputs
2324

@@ -41,11 +42,12 @@ jobs:
4142
runs-on: windows-latest
4243
steps:
4344
- uses: actions/checkout@v4
44-
- uses: microsoft/setup-msbuild@v1.1
45-
- uses: glslang/setup-masm@v1
45+
- uses: microsoft/setup-msbuild@v2
46+
- uses: glslang/setup-masm@v1.1
4647
with:
4748
vs-version: '2022'
4849
vs-prerelease: 'true'
50+
vs-architecture: 'x86'
4951
```
5052

5153
This example demonstrates how to set up MASM in a Windows-based workflow, ensuring that the necessary tools are available for building and testing your project.

action-types.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ inputs:
66
type: string
77
vs-prerelease:
88
type: boolean
9+
vs-architecture:
10+
type: enum
11+
name: Architecture
12+
allowed-values:
13+
- x86
14+
- x64
915

1016
outputs:
1117
masmPath:

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ inputs:
1414
vs-prerelease:
1515
description: "Enable searching for pre-release versions of Visual Studio/MSBuild"
1616
required: false
17+
vs-architecture:
18+
description: "The preferred processor architecture of MASM. Can be either 'x86' or 'x64'. 'x64' is only available from Visual Studio version 17.0 and later."
19+
required: false
20+
default: "x64"
1721
outputs:
1822
masmPath:
19-
description: "The resulting location of ml64 for your inputs"
23+
description: "The resulting location of ml (x86) or ml64 (x64) for your inputs"
2024

2125
runs:
2226
using: "node20"

0 commit comments

Comments
 (0)