Upgrade Mac CI/CD to macos-14 (#5856)

This commit is contained in:
SoftFever 2024-06-25 23:24:39 +08:00 committed by GitHub
parent 63dcf82f15
commit 7e85eb0d7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 18 deletions

View file

@ -49,9 +49,9 @@ jobs:
include: include:
- os: ubuntu-20.04 - os: ubuntu-20.04
- os: windows-latest - os: windows-latest
- os: macos-12 - os: macos-14
arch: x86_64 arch: x86_64
- os: macos-12 - os: macos-14
arch: arm64 arch: arm64
uses: ./.github/workflows/build_check_cache.yml uses: ./.github/workflows/build_check_cache.yml
with: with:

View file

@ -30,12 +30,12 @@ jobs:
- name: set outputs - name: set outputs
id: set_outputs id: set_outputs
env: 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 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-12' && '-' || ''}}${{ inputs.os == 'macos-12' && 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-12') && 'OrcaSlicer_dep' || 'destdir' }} 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"'}} output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
run: | 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 }} echo cache-path=${{ github.workspace }}/deps/build${{ env.underscore-arch }}/${{ env.dep-folder-name }}${{ env.underscore-arch }} >> ${{ env.output-cmd }}
- name: load cache - name: load cache

View file

@ -69,15 +69,16 @@ jobs:
cd ${{ github.workspace }}/deps/build cd ${{ github.workspace }}/deps/build
- name: Build on Mac ${{ inputs.arch }} - name: Build on Mac ${{ inputs.arch }}
if: inputs.os == 'macos-12' if: inputs.os == 'macos-14'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
brew install cmake git gettext automake texinfo ninja brew install cmake
brew install automake texinfo ninja libtool
brew list brew list
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }} mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }} mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }}
brew uninstall --ignore-dependencies zstd 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 brew install zstd
@ -102,7 +103,7 @@ jobs:
# Upload Artifacts # Upload Artifacts
- name: Upload Mac ${{ inputs.arch }} artifacts - name: Upload Mac ${{ inputs.arch }} artifacts
if: inputs.os == 'macos-12' if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }} name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }}

View file

@ -75,23 +75,24 @@ jobs:
# Mac # Mac
- name: Install tools mac - name: Install tools mac
if: inputs.os == 'macos-12' if: inputs.os == 'macos-14'
run: | run: |
brew install cmake git gettext tree ninja brew install cmake
brew install tree ninja libtool
brew list brew list
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}} mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{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}} tree ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
- name: Build slicer mac - name: Build slicer mac
if: inputs.os == 'macos-12' if: inputs.os == 'macos-14'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | 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 # Thanks to RaySajuuk, it's working now
- name: Sign app and notary - 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 }} working-directory: ${{ github.workspace }}
env: env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
@ -117,21 +118,21 @@ jobs:
xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
- name: Create DMG without notary - 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 }} working-directory: ${{ github.workspace }}
run: | run: |
ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications 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 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 - name: Upload artifacts mac
if: inputs.os == 'macos-12' if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }} name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
- name: Deploy Mac release - 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 uses: WebFreak001/deploy-nightly@v3.1.0
with: with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}

View file

@ -34,6 +34,9 @@ while getopts ":dpa:snt:xbc:h" opt; do
c ) c )
export BUILD_CONFIG="$OPTARG" export BUILD_CONFIG="$OPTARG"
;; ;;
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
;;
h ) echo "Usage: ./build_release_macos.sh [-d]" h ) echo "Usage: ./build_release_macos.sh [-d]"
echo " -d: Build deps only" echo " -d: Build deps only"
echo " -a: Set ARCHITECTURE (arm64 or x86_64)" echo " -a: Set ARCHITECTURE (arm64 or x86_64)"
@ -43,6 +46,7 @@ while getopts ":dpa:snt:xbc:h" opt; do
echo " -x: Use Ninja CMake generator, default is Xcode" echo " -x: Use Ninja CMake generator, default is Xcode"
echo " -b: Build without reconfiguring CMake" echo " -b: Build without reconfiguring CMake"
echo " -c: Set CMake build configuration, default is Release" echo " -c: Set CMake build configuration, default is Release"
echo " -1: Use single job for building"
exit 0 exit 0
;; ;;
* ) * )