K Framework Release (for debugging) 4851/merge #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Release (for debugging)' | |
| run-name: K Framework Release (for debugging) ${{ github.ref_name }} | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, edited, reopened, synchronize] | |
| branches: | |
| - 'develop' | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| jobs: | |
| set-release-id: | |
| name: 'Set Release ID' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: 'Get release_id' | |
| run: echo "release_id=$(jq --raw-output '.release.id' "$GITHUB_EVENT_PATH")" >> "${GITHUB_OUTPUT}" | |
| id: release | |
| outputs: | |
| release_id: ${{ steps.release.outputs.release_id }} | |
| source-tarball: | |
| name: 'Create source tarball' | |
| runs-on: ubuntu-24.04 | |
| environment: production | |
| steps: | |
| - name: 'Check out code' | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: 'Create source tarball' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }} | |
| run: | | |
| set -x | |
| version=$(cat package/version) | |
| tarball=kframework-${version}-src.tar.gz | |
| # shellcheck disable=SC2038 | |
| find . -name .git | xargs rm -r | |
| CURDIR=$(pwd) | |
| cd .. | |
| tar czvf "${tarball}" "$(basename "${CURDIR}")" | |
| mv "${tarball}" "${CURDIR}/" | |
| cd "${CURDIR}" | |
| gh release upload --repo runtimeverification/k --clobber "v${version}" "${tarball}" | |
| macos-build: | |
| name: 'Build MacOS Package' | |
| runs-on: macos-14 | |
| timeout-minutes: 120 | |
| environment: production | |
| needs: [set-release-id, source-tarball] | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| path: kframework | |
| - name: Check out matching homebrew repo branch | |
| uses: actions/checkout@v4 | |
| id: checkout | |
| with: | |
| repository: runtimeverification/homebrew-k | |
| path: homebrew-k | |
| ref: staging | |
| continue-on-error: true | |
| - name: Check out homebrew repo master branch | |
| uses: actions/checkout@v4 | |
| if: ${{ steps.checkout.outcome == 'failure' }} | |
| with: | |
| repository: runtimeverification/homebrew-k | |
| path: homebrew-k | |
| - name: Cache maven | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}- | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Mac Dependencies | |
| run: | | |
| # Via: https://github.com/ledger/ledger/commit/1eec9f86667cad3b0bbafb82a83739a0d30ca09f | |
| # Unlink and re-link to prevent errors when github mac runner images | |
| # install python outside of brew, for example: | |
| # https://github.com/orgs/Homebrew/discussions/3895 | |
| # https://github.com/actions/setup-python/issues/577 | |
| # https://github.com/actions/runner-images/issues/6459 | |
| # https://github.com/actions/runner-images/issues/6507 | |
| # https://github.com/actions/runner-images/issues/2322 | |
| # shellcheck disable=SC2162 | |
| brew list -1 | grep python | while read formula; do brew unlink "$formula"; brew link --overwrite "$formula"; done | |
| # uninstall pre-installed cmake | |
| brew uninstall cmake | |
| - name: Build brew bottle | |
| id: build | |
| env: | |
| HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | |
| MAVEN_OPTS: >- | |
| -Dhttp.keepAlive=false | |
| -Dmaven.wagon.http.pool=false | |
| -Dmaven.wagon.httpconnectionManager.ttlSeconds=30 | |
| run: | | |
| PACKAGE=kframework | |
| VERSION=$(cat kframework/package/version) | |
| ROOT_URL='https://github.com/runtimeverification/k/releases/download' | |
| wget "$ROOT_URL/v${VERSION}/kframework-${VERSION}-src.tar.gz" | |
| cd homebrew-k | |
| ../kframework/package/macos/brew-update-to-local "${PACKAGE}" "${VERSION}" | |
| git commit "Formula/$PACKAGE.rb" -m "Update ${PACKAGE} to ${VERSION}: part 1" | |
| ../kframework/package/macos/brew-build-and-update-to-local-bottle "${PACKAGE}" "${VERSION}" "${ROOT_URL}" | |
| git reset HEAD^ | |
| LOCAL_BOTTLE_NAME=$(basename "$(find . -name "kframework--${VERSION}.arm64_sonoma.bottle*.tar.gz")") | |
| # shellcheck disable=2001 | |
| BOTTLE_NAME=$(echo "${LOCAL_BOTTLE_NAME#./}" | sed 's!kframework--!kframework-!') | |
| ../kframework/package/macos/brew-update-to-final "${PACKAGE}" "${VERSION}" "${ROOT_URL}" | |
| echo "path=${LOCAL_BOTTLE_NAME}" >> "${GITHUB_OUTPUT}" | |
| echo "path_remote=${BOTTLE_NAME}" >> "${GITHUB_OUTPUT}" | |
| - name: Upload bottle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: homebrew | |
| path: homebrew-k | |
| - name: Delete Release | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{secrets.GITHUB_TOKEN}} | |
| script: | | |
| const { owner, repo } = context.repo | |
| await github.rest.repos.deleteRelease({ owner, repo, release_id: ${{ needs.set-release-id.outputs.release_id }} }) | |
| outputs: | |
| bottle_path: ${{ steps.build.outputs.path }} | |
| bottle_path_remote: ${{ steps.build.outputs.path_remote }} | |