forked from bambulab/BambuStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (190 loc) · 8.35 KB
/
Copy pathbuild_bambu.yml
File metadata and controls
216 lines (190 loc) · 8.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
on:
workflow_call:
inputs:
cache-key:
required: true
type: string
cache-path:
required: true
type: string
os:
required: true
type: string
arch:
required: false
type: string
jobs:
build_bambu:
name: Build BambuStudio
runs-on: ${{ inputs.os }}
env:
date:
ver:
ver_pure:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: 'true'
- name: load cached deps
uses: actions/cache@v5
with:
path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }}
fail-on-cache-miss: true
- name: Get the version and date on Ubuntu and macOS
if: inputs.os != 'windows-latest'
run: |
ver_pure=$(grep 'set(SLIC3R_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
else
ver=V$ver_pure
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash
- name: Get the version and date on Windows
if: inputs.os == 'windows-latest'
run: |
$date = Get-Date -Format 'yyyyMMdd'
$ref = "${{ github.ref }}"
$eventName = "${{ github.event_name }}"
$prNumber = "${{ github.event.number }}"
if ($eventName -eq 'pull_request') {
$ver = "PR" + $prNumber
} else {
$versionContent = Get-Content version.inc -Raw
if ($versionContent -match 'set\(SLIC3R_VERSION "(.*?)"\)') {
$ver = $matches[1]
}
$ver = "V$ver"
}
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date: ${{ env.date }} version: ${{ env.ver }}"
shell: pwsh
# Mac
- name: Build slicer mac
if: inputs.os == 'macos-15-intel'
working-directory: ${{ github.workspace }}
run: |
brew install automake texinfo
brew unlink cmake || true
brew tap-new $USER/old-cmake
brew extract --version=3.31.0 cmake $USER/old-cmake
brew install $USER/old-cmake/cmake@3.31.0
brew link --overwrite cmake@3.31.0
brew pin cmake@3.31.0
./BuildMac.sh -s -x -a x86_64 -t 10.15 -1
- name: Build slicer mac
if: inputs.os == 'macos-15' || inputs.os == 'macos-26'
working-directory: ${{ github.workspace }}
run: |
brew install automake texinfo
brew unlink cmake || true
brew tap-new $USER/old-cmake
brew extract --version=3.31.0 cmake $USER/old-cmake
brew install $USER/old-cmake/cmake@3.31.0
brew link --overwrite cmake@3.31.0
brew pin cmake@3.31.0
./BuildMac.sh -s -x -a universal -t 10.15 -1
- name: pack mac app
if: github.ref != 'refs/heads/main' && (inputs.os == 'macos-15-intel' || inputs.os == 'macos-15' || inputs.os == 'macos-26')
working-directory: ${{ github.workspace }}
run: zip -r BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}.zip ${{ github.workspace }}/build
- name: Upload artifacts mac
if: inputs.os == 'macos-15-intel' || inputs.os == 'macos-15' || inputs.os == 'macos-26'
uses: actions/upload-artifact@v6
with:
name: BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}
path: ${{ github.workspace }}/BambuStudio_Mac_${{inputs.arch}}_${{ env.ver }}.zip
# Windows
- name: setup MSVC
if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2
- name: Install nsis and pkgconfig
if: inputs.os == 'windows-latest'
run: |
dir "C:/Program Files (x86)/Windows Kits/10/Include"
choco install nsis
choco install pkgconfiglite
- name: Build slicer Win
if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 18 2026" -A X64 -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0 -DCMAKE_PREFIX_PATH="${{ github.workspace }}\deps\build\BambuStudio_dep\usr\local" -DCMAKE_INSTALL_PREFIX="../install-dir" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
cmake --build . --target install --config Release -- -m
# - name: Create installer Win
# if: inputs.os == 'windows-latest'
# working-directory: ${{ github.workspace }}/build
# run: |
# cpack -G NSIS
- name: Pack app
if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }}
shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -tzip BambuStudio_Windows_${{ env.ver }}_portable.zip ${{ github.workspace }}/install-dir'
# - name: Pack PDB
# if: inputs.os == 'windows-latest'
# working-directory: ${{ github.workspace }}/build/src/Release
# shell: cmd
# run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
- name: Upload artifacts Win zip
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v6
with:
name: BambuStudio_Windows_${{ env.ver }}_portable
path: ${{ github.workspace }}/BambuStudio_Windows_${{ env.ver }}_portable.zip
# Ubuntu
- name: Install dependencies from BuildLinux.sh
if: inputs.os == 'ubuntu-22.04' || inputs.os == 'ubuntu-24.04' || inputs.os == 'ubuntu-26.04'
shell: bash
run: sudo ./BuildLinux.sh -ur
- name: Fix permissions
if: inputs.os == 'ubuntu-22.04' || inputs.os == 'ubuntu-24.04' || inputs.os == 'ubuntu-26.04'
shell: bash
run: sudo chown $USER -R ./
- name: Build slicer
if: inputs.os == 'ubuntu-22.04' || inputs.os == 'ubuntu-24.04' || inputs.os == 'ubuntu-26.04'
shell: bash
run: |
./BuildLinux.sh -isfr
mv -n ./build/BambuStudio_ubu64.AppImage ./build/Bambu_Studio_${{inputs.os}}_${{ env.ver }}.AppImage
# - name: Build orca_custom_preset_tests
# if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-22.04'
# working-directory: ${{ github.workspace }}/build/src
# shell: bash
# run: |
# ./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -g 1
# cd ${{ github.workspace }}/resources/profiles
# zip -r orca_custom_preset_tests.zip user/
- name: Upload artifacts Ubuntu
if: ${{ ! env.ACT && (inputs.os == 'ubuntu-22.04' || inputs.os == 'ubuntu-24.04' || inputs.os == 'ubuntu-26.04') }}
uses: actions/upload-artifact@v6
with:
name: BambuStudio_${{inputs.os}}_${{ env.ver }}
path: './build/Bambu_Studio_${{inputs.os}}_${{ env.ver }}.AppImage'
# - name: Deploy Ubuntu release
# if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-22.04' }}
# uses: WebFreak001/deploy-nightly@v3.2.0
# with:
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
# release_id: 137995723
# asset_path: ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage
# asset_name: OrcaSlicer_Linux_${{ env.ver }}.AppImage
# asset_content_type: application/octet-stream
# max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
# - name: Deploy orca_custom_preset_tests
# if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-22.04' }}
# uses: WebFreak001/deploy-nightly@v3.2.0
# with:
# upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
# release_id: 137995723
# asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip
# asset_name: orca_custom_preset_tests.zip
# asset_content_type: application/octet-stream
# max_releases: 1