@@ -309,205 +309,6 @@ jobs:
309309 path : |
310310 **/kore-exec.tar.gz
311311
312- macos-build :
313- name : ' Build MacOS Package'
314- runs-on : macos-latest
315- timeout-minutes : 120
316- environment : production
317- needs : [set-release-id, source-tarball]
318- continue-on-error : true # Do not fail releases due to MacOS builds at this time. Oct. 6, 2025
319- steps :
320- - name : Check out code
321- uses : actions/checkout@v4
322- with :
323- submodules : recursive
324- path : kframework
325-
326- - name : Check out matching homebrew repo branch
327- uses : actions/checkout@v4
328- id : checkout
329- with :
330- repository : runtimeverification/homebrew-k
331- path : homebrew-k
332- ref : staging
333- continue-on-error : true
334-
335- - name : Check out homebrew repo master branch
336- uses : actions/checkout@v4
337- if : ${{ steps.checkout.outcome == 'failure' }}
338- with :
339- repository : runtimeverification/homebrew-k
340- path : homebrew-k
341-
342- - name : Cache maven
343- uses : actions/cache@v4
344- with :
345- path : ~/.m2/repository
346- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-
347- restore-keys : |
348- ${{ runner.os }}-maven-
349-
350- - name : Mac Dependencies
351- run : |
352- # Via: https://github.com/ledger/ledger/commit/1eec9f86667cad3b0bbafb82a83739a0d30ca09f
353- # Unlink and re-link to prevent errors when github mac runner images
354- # install python outside of brew, for example:
355- # https://github.com/orgs/Homebrew/discussions/3895
356- # https://github.com/actions/setup-python/issues/577
357- # https://github.com/actions/runner-images/issues/6459
358- # https://github.com/actions/runner-images/issues/6507
359- # https://github.com/actions/runner-images/issues/2322
360-
361- # shellcheck disable=SC2162
362- brew list -1 | grep python | while read formula; do brew unlink "$formula"; brew link --overwrite "$formula"; done
363-
364- # uninstall pre-installed cmake
365- brew uninstall cmake
366-
367- - name : Build brew bottle
368- id : build
369- env :
370- HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK : 1
371- MAVEN_OPTS : >-
372- -Dhttp.keepAlive=false
373- -Dmaven.wagon.http.pool=false
374- -Dmaven.wagon.httpconnectionManager.ttlSeconds=30
375- run : |
376- PACKAGE=kframework
377- VERSION=$(cat kframework/package/version)
378- ROOT_URL='https://github.com/runtimeverification/k/releases/download'
379- wget "$ROOT_URL/v${VERSION}/kframework-${VERSION}-src.tar.gz"
380- cd homebrew-k
381- ../kframework/package/macos/brew-update-to-local "${PACKAGE}" "${VERSION}"
382- git commit "Formula/$PACKAGE.rb" -m "Update ${PACKAGE} to ${VERSION}: part 1"
383- ../kframework/package/macos/brew-build-and-update-to-local-bottle "${PACKAGE}" "${VERSION}" "${ROOT_URL}"
384- git reset HEAD^
385- LOCAL_BOTTLE_NAME=$(basename "$(find . -name "kframework--${VERSION}.arm64_sonoma.bottle*.tar.gz")")
386- # shellcheck disable=2001
387- BOTTLE_NAME=$(echo "${LOCAL_BOTTLE_NAME#./}" | sed 's!kframework--!kframework-!')
388- ../kframework/package/macos/brew-update-to-final "${PACKAGE}" "${VERSION}" "${ROOT_URL}"
389- echo "path=${LOCAL_BOTTLE_NAME}" >> "${GITHUB_OUTPUT}"
390- echo "path_remote=${BOTTLE_NAME}" >> "${GITHUB_OUTPUT}"
391-
392- - name : Upload bottle
393- uses : actions/upload-artifact@v4
394- with :
395- name : homebrew
396- path : homebrew-k
397-
398- outputs :
399- bottle_path : ${{ steps.build.outputs.path }}
400- bottle_path_remote : ${{ steps.build.outputs.path_remote }}
401-
402- macos-test :
403- name : ' Test MacOS Package'
404- runs-on : macos-latest
405- timeout-minutes : 60
406- environment : production
407- needs : [macos-build, set-release-id]
408- continue-on-error : true # Do not fail releases due to MacOS tests at this time. Oct. 6, 2025
409- steps :
410- - name : ' Check out matching homebrew repo branch'
411- uses : actions/checkout@v4
412- id : checkout
413- with :
414- repository : runtimeverification/homebrew-k
415- token : ${{ secrets.JENKINS_GITHUB_PAT }}
416- path : homebrew-k
417- ref : staging
418- continue-on-error : true
419-
420- - name : ' Check out homebrew repo master branch'
421- uses : actions/checkout@v4
422- if : ${{ steps.checkout.outcome == 'failure' }}
423- with :
424- repository : runtimeverification/homebrew-k
425- token : ${{ secrets.JENKINS_GITHUB_PAT }}
426- path : homebrew-k
427-
428- - name : ' Download bottle'
429- uses : actions/download-artifact@v4
430- with :
431- name : homebrew
432- path : homebrew-k-old
433-
434- - name : Mac Dependencies
435- run : |
436- # Via: https://github.com/ledger/ledger/commit/1eec9f86667cad3b0bbafb82a83739a0d30ca09f
437- # Unlink and re-link to prevent errors when github mac runner images
438- # install python outside of brew, for example:
439- # https://github.com/orgs/Homebrew/discussions/3895
440- # https://github.com/actions/setup-python/issues/577
441- # https://github.com/actions/runner-images/issues/6459
442- # https://github.com/actions/runner-images/issues/6507
443- # https://github.com/actions/runner-images/issues/2322
444-
445- # shellcheck disable=SC2162
446- brew list -1 | grep python | while read formula; do brew unlink "$formula"; brew link --overwrite "$formula"; done
447-
448- - name : ' Test brew bottle'
449- id : test
450- env :
451- # github actions sets the JAVA_HOME variable to Java 8 explicitly for
452- # some reason. There doesn't seem to be a way to tell it to unset the
453- # variable, so instead we just have to tell it to use Java 17
454- # explicitly instead.
455- JAVA_HOME : ${{ env.JAVA_HOME_17_X64 }}
456- HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK : 1
457- run : |
458- # The macOS public runners are prone to flakiness when running this
459- # test suite, so the PL-tutorial is disabled for now.
460- # - https://github.com/runtimeverification/k/issues/3705
461- cd homebrew-k-old
462- # brew tap expects a git repository, so we initialise the current folder as a dummy repo
463- git init
464- brew tap runtimeverification/k "file:///$(pwd)"
465- # Install the formula using the local bottle file
466- # First, check what files are available
467- ls -la
468- # Try to install using the bottle file pattern like the original script
469- brew install kframework--*.bottle*.tar.gz -v
470- # cp -R /usr/local/share/kframework/pl-tutorial ~
471- # WD=`pwd`
472- # cd
473- # echo 'Starting kserver...'
474- # spawn-kserver $WD/kserver.log
475- # cd pl-tutorial
476- # echo 'Testing tutorial in user environment...'
477- # make -j`sysctl -n hw.ncpu` ${MAKE_EXTRA_ARGS}
478- # cd ~
479- echo 'module TEST imports BOOL endmodule' > test.k
480- kompile test.k --backend llvm
481- kompile test.k --backend haskell
482-
483- - name : ' Check out code'
484- uses : actions/checkout@v4
485- with :
486- path : k-homebrew-checkout
487- token : ${{ secrets.JENKINS_GITHUB_PAT }}
488-
489- - name : ' Upload Package to Release'
490- env :
491- GITHUB_TOKEN : ${{ secrets.JENKINS_GITHUB_PAT }}
492- BOTTLE_NAME : ${{ needs.macos-build.outputs.bottle_path }}
493- REMOTE_BOTTLE_NAME : ${{ needs.macos-build.outputs.bottle_path_remote }}
494- run : |
495- set -x
496- version=$(cat k-homebrew-checkout/package/version)
497- mv "homebrew-k-old/${BOTTLE_NAME}" "homebrew-k-old/${REMOTE_BOTTLE_NAME}"
498- gh release upload --repo runtimeverification/k --clobber "v${version}" "homebrew-k-old/${REMOTE_BOTTLE_NAME}"
499-
500- - run : |
501- git config --global user.name rv-jenkins
502- git config --global user.email devops@runtimeverification.com
503-
504- - name : ' Commit changes'
505- run : |
506- cp homebrew-k-old/Formula/kframework.rb homebrew-k/Formula/kframework.rb
507- cd homebrew-k
508- git commit -m 'Update brew package version' Formula/kframework.rb
509- git push origin master
510-
511312 release :
512313 name : ' Publish Release'
513314 runs-on : [self-hosted, linux, normal]
0 commit comments