Skip to content

Commit 5e659c7

Browse files
committed
Build/test on Windows 11 ARM machines
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
1 parent ee04298 commit 5e659c7

3 files changed

Lines changed: 39 additions & 34 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go-version-file: 'go.mod'
2020

2121
- name: Compile gauge
22-
run: go run build/make.go --all-platforms --skip-windows
22+
run: go run build/make.go --all-platforms --skip-windows
2323

2424
- name: Create distro
2525
run: |
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Compile gauge
4646
run: |
47-
go run build/make.go --verbose --all-platforms
47+
go run build/make.go --verbose --all-platforms --skip-non-windows
4848
Get-ChildItem -Recurse .\bin
4949
5050
- name: Install NSIS

.github/workflows/tests.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
18-
os: [windows-latest, ubuntu-latest, macos-latest]
18+
os: [windows-latest, windows-11-arm, ubuntu-latest, macos-latest]
1919

2020
steps:
2121
- uses: actions/checkout@v6
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ${{ matrix.os }}
3434
strategy:
3535
matrix:
36-
os: [windows-latest, ubuntu-latest]
36+
os: [windows-latest, windows-11-arm, ubuntu-latest]
3737
steps:
3838
- uses: actions/checkout@v6
3939
- name: Set up Go
@@ -59,13 +59,13 @@ jobs:
5959
npm install
6060
6161
- name: Install Gauge (windows)
62-
if: matrix.os == 'windows-latest'
62+
if: ${{ startsWith(matrix.os, 'windows') }}
6363
run: |
6464
go run build/make.go --install --verbose
6565
echo "C:\\Program Files\\gauge\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
6666
67-
- name: Install Gauge (linux)
68-
if: matrix.os != 'windows-latest'
67+
- name: Install Gauge (linux/macos)
68+
if: ${{ !startsWith(matrix.os, 'windows') }}
6969
run: |
7070
go run build/make.go --install --prefix=/tmp/gauge --verbose
7171
echo "/tmp/gauge/bin" >> $GITHUB_PATH
@@ -100,7 +100,7 @@ jobs:
100100
TAGS: js
101101
strategy:
102102
matrix:
103-
os: [windows-latest, ubuntu-latest]
103+
os: [windows-latest, windows-11-arm, ubuntu-latest]
104104
steps:
105105
- uses: actions/checkout@v6
106106
- name: Set up Go
@@ -118,13 +118,13 @@ jobs:
118118
run: go run build/make.go --verbose
119119

120120
- name: Install Gauge (windows)
121-
if: matrix.os == 'windows-latest'
121+
if: ${{ startsWith(matrix.os, 'windows') }}
122122
run: |
123123
go run build/make.go --install --verbose
124124
echo "C:\\Program Files\\gauge\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
125125
126-
- name: Install Gauge (linux)
127-
if: matrix.os != 'windows-latest'
126+
- name: Install Gauge (linux/macos)
127+
if: ${{ !startsWith(matrix.os, 'windows') }}
128128
run: |
129129
go run build/make.go --install --prefix=/tmp/gauge --verbose
130130
echo "/tmp/gauge/bin" >> $GITHUB_PATH
@@ -173,13 +173,13 @@ jobs:
173173
gauge install
174174
175175
- name: Install gauge and Run FTs (windows)
176-
if: matrix.os == 'windows-latest'
176+
if: ${{ startsWith(matrix.os, 'windows') }}
177177
run: |
178178
cd gauge-tests
179179
.\gradlew.bat clean jsFT
180180
181-
- name: Install gauge and Run FTs (linux/osx)
182-
if: matrix.os != 'windows-latest'
181+
- name: Install gauge and Run FTs (linux/macos)
182+
if: ${{ !startsWith(matrix.os, 'windows') }}
183183
run: |
184184
cd gauge-tests
185185
./gradlew clean jsFT
@@ -197,7 +197,7 @@ jobs:
197197
needs: [ functional-tests, lsp-tests ]
198198
strategy:
199199
matrix:
200-
os: [windows-latest, ubuntu-latest, macos-latest]
200+
os: [windows-latest, windows-11-arm, ubuntu-latest, macos-latest]
201201

202202
steps:
203203
- uses: actions/checkout@v6
@@ -209,7 +209,7 @@ jobs:
209209
go-version-file: 'go.mod'
210210

211211
- name: Install NSIS (windows)
212-
if: matrix.os == 'windows-latest'
212+
if: ${{ startsWith(matrix.os, 'windows') }}
213213
env:
214214
NSIS_VERSION: '3.11'
215215
run: |

build/make.go

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ var targetLinux = flag.Bool("target-linux", false, "Compiles for linux only, bot
144144
var binDir = flag.String("bin-dir", "", "Specifies OS_PLATFORM specific binaries to install when cross compiling")
145145
var distro = flag.Bool("distro", false, "Create gauge distributable")
146146
var verbose = flag.Bool("verbose", false, "Print verbose details")
147-
var skipWindowsDistro = flag.Bool("skip-windows", false, "Skips creation of windows distributable on unix machines while cross platform compilation")
147+
var skipWindowsDistro = flag.Bool("skip-windows", false, "Skips creation of windows distributables on unix machines during cross platform compilation")
148+
var skipNonWindowsDistro = flag.Bool("skip-non-windows", false, "Skips creation of non-windows distributables during cross platform compilation")
148149
var certFile = flag.String("certFile", "", "Should be passed for signing the windows installer")
149150

150151
// Defines all the compile targets
@@ -295,33 +296,37 @@ func signExecutable(exeFilePath string, certFilePath string) {
295296
}
296297

297298
func createDarwinPackage() {
298-
distroDir := filepath.Join(deploy, packageName())
299-
copyGaugeBinaries(distroDir)
300-
if id := os.Getenv("OS_SIGNING_IDENTITY"); id == "" {
301-
log.Printf("No signing identity found . Executable won't be signed.")
302-
} else {
303-
runProcess("codesign", "-s", id, "--force", "--deep", filepath.Join(distroDir, gauge))
304-
}
305-
createZipFromUtil(deploy, packageName(), packageName())
306-
if err := os.RemoveAll(distroDir); err != nil {
307-
log.Printf("failed to remove %s", distroDir)
299+
if !*skipNonWindowsDistro {
300+
distroDir := filepath.Join(deploy, packageName())
301+
copyGaugeBinaries(distroDir)
302+
if id := os.Getenv("OS_SIGNING_IDENTITY"); id == "" {
303+
log.Printf("No signing identity found . Executable won't be signed.")
304+
} else {
305+
runProcess("codesign", "-s", id, "--force", "--deep", filepath.Join(distroDir, gauge))
306+
}
307+
createZipFromUtil(deploy, packageName(), packageName())
308+
if err := os.RemoveAll(distroDir); err != nil {
309+
log.Printf("failed to remove %s", distroDir)
310+
}
308311
}
309312
}
310313

311314
func createLinuxPackage() {
312-
distroDir := filepath.Join(deploy, packageName())
313-
copyGaugeBinaries(distroDir)
314-
createZipFromUtil(deploy, packageName(), packageName())
315-
if err := os.RemoveAll(distroDir); err != nil {
316-
log.Printf("failed to remove %s", distroDir)
315+
if !*skipNonWindowsDistro {
316+
distroDir := filepath.Join(deploy, packageName())
317+
copyGaugeBinaries(distroDir)
318+
createZipFromUtil(deploy, packageName(), packageName())
319+
if err := os.RemoveAll(distroDir); err != nil {
320+
log.Printf("failed to remove %s", distroDir)
321+
}
317322
}
318323
}
319324

320325
func packageName() string {
321326
return fmt.Sprintf("%s-%s-%s.%s", gauge, getBuildVersion(), getGOOS(), getPackageArchSuffix())
322327
}
323328

324-
func removeUnwatedFiles(dir, currentOS string) error {
329+
func removeUnwantedFiles(dir, currentOS string) error {
325330
fileList := []string{
326331
".DS_STORE",
327332
".localized",
@@ -355,7 +360,7 @@ func createZipFromUtil(dir, zipDir, pkgName string) {
355360

356361
windowsZipScript := filepath.Join(wd, "build", "create_windows_zipfile.ps1")
357362

358-
err = removeUnwatedFiles(filepath.Join(dir, zipDir), currentOS)
363+
err = removeUnwantedFiles(filepath.Join(dir, zipDir), currentOS)
359364

360365
if err != nil {
361366
panic(fmt.Sprintf("Failed to cleanup unwanted file(s): %s", err))

0 commit comments

Comments
 (0)