Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Mac CI/CD to macos-14 #5856

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
include:
- os: ubuntu-20.04
- os: windows-latest
- os: macos-12
- os: macos-14
arch: x86_64
- os: macos-12
- os: macos-14
arch: arm64
uses: ./.github/workflows/build_check_cache.yml
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_check_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
- name: set outputs
id: set_outputs
env:
underscore-arch: ${{ inputs.os == 'macos-12' && '_' || ''}}${{ inputs.os == 'macos-12' && inputs.arch || '' }} # if is macos, make a string that does "_{arch}", else output nothing
dash-arch: ${{ inputs.os == 'macos-12' && '-' || ''}}${{ inputs.os == 'macos-12' && inputs.arch || '' }} # if is macos, make a string that does "-{arch}", else output nothing
dep-folder-name: ${{ (inputs.os == 'windows-latest' || inputs.os == 'macos-12') && 'OrcaSlicer_dep' || 'destdir' }}
underscore-arch: ${{ inputs.os == 'macos-14' && '_' || ''}}${{ inputs.os == 'macos-14' && inputs.arch || '' }} # if is macos, make a string that does "_{arch}", else output nothing
dash-arch: ${{ inputs.os == 'macos-14' && '-' || ''}}${{ inputs.os == 'macos-14' && inputs.arch || '' }} # if is macos, make a string that does "-{arch}", else output nothing
dep-folder-name: ${{ (inputs.os == 'windows-latest' || inputs.os == 'macos-14') && 'OrcaSlicer_dep' || 'destdir' }}
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
run: |
echo cache-key=${{ runner.os }}${{ env.dash-arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
echo cache-key=${{ inputs.os }}${{ env.dash-arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
echo cache-path=${{ github.workspace }}/deps/build${{ env.underscore-arch }}/${{ env.dep-folder-name }}${{ env.underscore-arch }} >> ${{ env.output-cmd }}

- name: load cache
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ jobs:
cd ${{ github.workspace }}/deps/build

- name: Build on Mac ${{ inputs.arch }}
if: inputs.os == 'macos-12'
if: inputs.os == 'macos-14'
working-directory: ${{ github.workspace }}
run: |
brew install cmake git gettext automake texinfo ninja
brew install cmake
brew install automake texinfo ninja libtool
brew list
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }}
brew uninstall --ignore-dependencies zstd
./build_release_macos.sh -dpx -a ${{ inputs.arch }} -t 10.15
./build_release_macos.sh -dpx -a ${{ inputs.arch }} -t 10.15 -1
brew install zstd


Expand All @@ -102,7 +103,7 @@ jobs:

# Upload Artifacts
- name: Upload Mac ${{ inputs.arch }} artifacts
if: inputs.os == 'macos-12'
if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build_orca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,24 @@ jobs:

# Mac
- name: Install tools mac
if: inputs.os == 'macos-12'
if: inputs.os == 'macos-14'
run: |
brew install cmake git gettext tree ninja
brew install cmake
brew install tree ninja libtool
brew list
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
tree ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}

- name: Build slicer mac
if: inputs.os == 'macos-12'
if: inputs.os == 'macos-14'
working-directory: ${{ github.workspace }}
run: |
./build_release_macos.sh -s -n -x -a ${{inputs.arch}} -t 10.15
./build_release_macos.sh -s -n -x -a ${{inputs.arch}} -t 10.15 -1

# Thanks to RaySajuuk, it's working now
- name: Sign app and notary
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-12'
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-14'
working-directory: ${{ github.workspace }}
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
Expand All @@ -117,21 +118,21 @@ jobs:
xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg

- name: Create DMG without notary
if: github.ref != 'refs/heads/main' && inputs.os == 'macos-12'
if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14'
working-directory: ${{ github.workspace }}
run: |
ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg

- name: Upload artifacts mac
if: inputs.os == 'macos-12'
if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg

- name: Deploy Mac release
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-12'
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14'
uses: WebFreak001/deploy-nightly@v3.1.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
Expand Down
4 changes: 4 additions & 0 deletions build_release_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ while getopts ":dpa:snt:xbc:h" opt; do
c )
export BUILD_CONFIG="$OPTARG"
;;
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
;;
h ) echo "Usage: ./build_release_macos.sh [-d]"
echo " -d: Build deps only"
echo " -a: Set ARCHITECTURE (arm64 or x86_64)"
Expand All @@ -43,6 +46,7 @@ while getopts ":dpa:snt:xbc:h" opt; do
echo " -x: Use Ninja CMake generator, default is Xcode"
echo " -b: Build without reconfiguring CMake"
echo " -c: Set CMake build configuration, default is Release"
echo " -1: Use single job for building"
exit 0
;;
* )
Expand Down