Skip to content

Commit 79ab42a

Browse files
committed
INTERNAL: Updating changelog, Github workflow.
Also rolling back those workflow changes. Hotfix: Also fixing the sound being crackly on Windows by defaulting to 44.1khz @ 1024 buffer size (512 is too small).
1 parent e884d4c commit 79ab42a

File tree

10 files changed

+426
-388
lines changed

10 files changed

+426
-388
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@ jobs:
2020
sudo apt install libasound2-dev
2121
2222
- name: Build
23-
run: go run ./build_script/main.go -b -c
23+
run: |
24+
go run build_script/build.go -b -c
2425
2526
- uses: actions/upload-artifact@v4
2627
with:
27-
name: _gh-actions-masterplan-linux-release-amd64-v0.9
28+
name: Linux-0.9-Release-amd64
2829
path: ./bin/linux-0.9-Release-amd64.tar.gz
2930

3031
- uses: actions/upload-artifact@v4
3132
with:
32-
name: _gh-actions-masterplan-linux-demo-amd64-v0.9
33+
name: Linux-0.9-Demo-amd64
3334
path: ./bin/linux-0.9-Demo-amd64.tar.gz
3435

35-
- name: Test
36-
run: go run .
36+
# - name: Test
37+
# run: timeout 10s go run .
3738

3839
# For some reason, building on Windows creates a terminal window despite specifying -H=windowsgui in the build settings. For now, I'll crosscompile on my machine.
3940

@@ -54,20 +55,24 @@ jobs:
5455
run: pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-go --noconfirm
5556

5657
- name: Build
57-
run: go run ./build_script/main.go -b -c
58+
run: |
59+
go run build_script/build.go -b -c
5860
5961
- uses: actions/upload-artifact@v4
6062
with:
61-
name: _GH-Actions-MasterPlan-Windows-amd64-Release-v0.9
63+
name: Windows-0.9-Release-amd64
6264
path: ./bin/windows-0.9-Release-amd64.zip
6365

6466
- uses: actions/upload-artifact@v4
6567
with:
66-
name: _GH-Actions-MasterPlan-Windows-amd64-Demo-v0.9
68+
name: Windows-0.9-Demo-amd64
6769
path: ./bin/windows-0.9-Demo-amd64.zip
6870

69-
- name: Test
70-
run: go run .
71+
# - name: Test
72+
# run: |
73+
# start go run .
74+
# timeout /t 10
75+
# taskkill /im go /f
7176

7277
buildMacAmd64:
7378
runs-on: macos-13 # Earliest MacOS, deprecated
@@ -80,29 +85,31 @@ jobs:
8085
go-version: 1.24
8186

8287
- name: Download Pre-reqs
83-
run: brew install pkg-config dylibbundler
88+
run: brew install dylibbundler
8489

8590
- name: Build
86-
run: go run ./build_script/main.go -b
91+
run: go run build_script/build.go -b
8792

8893
- name: Bundle Dependencies
89-
run: dylibbundler -od -b -x ./bin/darwin-0.9-Release-amd64/MasterPlan.app/Contents/MacOS/masterplan -d ./bin/darwin-0.9-Release-amd64/MasterPlan.app/Contents/libs -p @executable_path/../libs
94+
run: |
95+
dylibbundler -od -b -x ./bin/darwin-0.9-Release-amd64/MasterPlan.app/Contents/MacOS/masterplan -d ./bin/darwin-0.9-Release-amd64/MasterPlan.app/Contents/libs -p @executable_path/../libs
96+
dylibbundler -od -b -x ./bin/darwin-0.9-Demo-amd64/MasterPlan.app/Contents/MacOS/masterplan -d ./bin/darwin-0.9-Demo-amd64/MasterPlan.app/Contents/libs -p @executable_path/../libs
9097
9198
- name: Compress
92-
run: go run ./build_script/main.go -c
99+
run: go run build_script/build.go -c
93100

94101
- uses: actions/upload-artifact@v4
95102
with:
96-
name: _GH-Actions-MasterPlan-MacOS-amd64-Release-v0.9
103+
name: MacOS-0.9-Release-amd64
97104
path: ./bin/darwin-0.9-Release-amd64.tar.gz
98105

99106
- uses: actions/upload-artifact@v4
100107
with:
101-
name: _GH-Actions-MasterPlan-MacOS-Demo-amd64-v0.9
102-
path: ./bin/darwin-0.9-Release-amd64.tar.gz
108+
name: MacOS-0.9-Demo-amd64
109+
path: ./bin/darwin-0.9-Demo-amd64.tar.gz
103110

104-
- name: Test
105-
run: go run .
111+
# - name: Test
112+
# run: go run .
106113

107114
buildMacArm64:
108115
runs-on: macos-14 # Deprecated, earliest ARM64 on GH Runners
@@ -115,26 +122,28 @@ jobs:
115122
go-version: 1.24
116123

117124
- name: Download Pre-reqs
118-
run: brew install pkg-config dylibbundler
125+
run: brew install dylibbundler
119126

120127
- name: Build
121-
run: go run ./build_script/main.go -b -os darwin -arch arm64
128+
run: go run build_script/build.go -b -os darwin -arch arm64
122129

123130
- name: Bundle Dependencies
124-
run: dylibbundler -od -b -x ./bin/darwin-0.9-Release-arm64/MasterPlan.app/Contents/MacOS/masterplan -d ./bin/darwin-0.9-Release-arm64/MasterPlan.app/Contents/libs -p @executable_path/../libs
131+
run: |
132+
dylibbundler -od -b -x ./bin/darwin-0.9-Release-arm64/MasterPlan.app/Contents/MacOS/masterplan -d ./bin/darwin-0.9-Release-arm64/MasterPlan.app/Contents/libs -p @executable_path/../libs
133+
dylibbundler -od -b -x ./bin/darwin-0.9-Demo-arm64/MasterPlan.app/Contents/MacOS/masterplan -d ./bin/darwin-0.9-Demo-arm64/MasterPlan.app/Contents/libs -p @executable_path/../libs
125134
126135
- name: Compress
127-
run: go run ./build_script/main.go -c
136+
run: go run build_script/build.go -c
128137

129138
- uses: actions/upload-artifact@v4
130139
with:
131-
name: _GH-Actions-MasterPlan-MacOS-arm64-Release-v0.9
140+
name: MacOS-0.9-Release-arm64
132141
path: bin/darwin-0.9-Release-arm64.tar.gz
133142

134143
- uses: actions/upload-artifact@v4
135144
with:
136-
name: _GH-Actions-MasterPlan-MacOS-arm64-Demo-v0.9
145+
name: MacOS-0.9-Demo-arm64
137146
path: bin/darwin-0.9-Demo-arm64.tar.gz
138147

139-
- name: Test
140-
run: go run .
148+
# - name: Test
149+
# run: go run .

build_script/build.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
3737
panic(err)
3838
}
3939

40-
copyTo(filepath.Join("..", "changelog.txt"), filepath.Join(baseDir, "changelog.txt"))
40+
copyTo("changelog.txt", filepath.Join(baseDir, "changelog.txt"))
4141

4242
if forMac {
4343
baseDir = filepath.Join(baseDir, "MasterPlan.app", "Contents", "MacOS")
4444
}
4545

4646
// Copy the assets folder to the bin directory
4747

48-
copyTo(filepath.Join("..", "assets"), filepath.Join(baseDir, "assets"))
48+
copyTo("assets", filepath.Join(baseDir, "assets"))
4949

5050
fmt.Println("<Assets copied.>")
5151

@@ -57,7 +57,7 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
5757

5858
// Copy the resources.syso so the executable has the generated icon and executable properties compiled in.
5959
// This is done using go generate with goversioninfo downloaded and "// go:generate goversioninfo -64=true" in main.go.
60-
copyTo(filepath.Join("..", "other_sources", "resource.syso"), filepath.Join("..", "resource.syso"))
60+
copyTo(filepath.Join("other_sources", "resource.syso"), filepath.Join("..", "resource.syso"))
6161

6262
// Copy in the SDL requirements (.dll files)
6363
filepath.Walk(filepath.Join("other_sources"), func(path string, info fs.FileInfo, err error) error {
@@ -96,9 +96,9 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
9696

9797
// Also note that I know it's weird that I'm joining the build script directory here because baseDir is already a folder up; this makes it so
9898
// bin is the running directory
99-
c = exec.Command(`go`, `build`, `-C`, `..`, `-ldflags`, `-s -w -H windowsgui`, `-tags`, releaseMode, `-o`, filepath.Join("build_script", outputFilepath), `.`)
99+
c = exec.Command(`go`, `build`, `-ldflags`, `-s -w -H windowsgui`, `-tags`, releaseMode, `-o`, outputFilepath, `.`)
100100
} else {
101-
c = exec.Command(`go`, `build`, `-C`, `..`, `-ldflags`, `-s -w`, `-tags`, releaseMode, `-o`, filepath.Join("build_script", outputFilepath), `.`)
101+
c = exec.Command(`go`, `build`, `-ldflags`, `-s -w`, `-tags`, releaseMode, `-o`, outputFilepath, `.`)
102102
}
103103

104104
fmt.Println("<Building binary with args: ", c.Args, ".>")
@@ -113,8 +113,8 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
113113
// Add the stuff for Mac
114114
if forMac {
115115
baseDir = filepath.Clean(filepath.Join(baseDir, ".."))
116-
copyTo(filepath.Join("..", "other_sources", "Info.plist"), filepath.Join(baseDir, "Info.plist"))
117-
copyTo(filepath.Join("..", "other_sources", "macicons.icns"), filepath.Join(baseDir, "Resources", "macicons.icns"))
116+
copyTo(filepath.Join("other_sources", "Info.plist"), filepath.Join(baseDir, "Info.plist"))
117+
copyTo(filepath.Join("other_sources", "macicons.icns"), filepath.Join(baseDir, "Resources", "macicons.icns"))
118118
}
119119

120120
// The final executable should be, well, executable for everybody. 0777 should do it for Mac and Linux.
@@ -127,7 +127,7 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
127127

128128
if forWin {
129129
// Remove Resources; we don't need it in the root directory anymore after building.
130-
os.Remove(filepath.Join("..", "resource.syso"))
130+
os.Remove(filepath.Join("resource.syso"))
131131
}
132132

133133
}
@@ -255,8 +255,8 @@ func main() {
255255
targetArch = *archFlag
256256
}
257257

258-
build(filepath.Join("..", "bin", targetName+"-0.9-Release-"+targetArch), "release", targetName, targetArch)
259-
build(filepath.Join("..", "bin", targetName+"-0.9-Demo-"+targetArch), "demo", targetName, targetArch)
258+
build(filepath.Join("bin", targetName+"-0.9-Release-"+targetArch), "release", targetName, targetArch)
259+
build(filepath.Join("bin", targetName+"-0.9-Demo-"+targetArch), "demo", targetName, targetArch)
260260
}
261261
if *compressMP {
262262
compress() // Compresses all built binary folders in the ./bin folder

build_script/go.mod

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)