From e7abf07f0e2b8342e73993035b2640db6c18f582 Mon Sep 17 00:00:00 2001 From: Savely Krendelhoff Date: Tue, 26 Nov 2024 11:48:41 +0700 Subject: [PATCH] [TMP] --- .github/workflows/build-bottles.yml | 52 ++------------------- Formula/tezos-smart-rollup-wasm-debugger.rb | 5 +- scripts/build-one-bottle.sh | 2 +- 3 files changed, 7 insertions(+), 52 deletions(-) diff --git a/.github/workflows/build-bottles.yml b/.github/workflows/build-bottles.yml index c8a836f19..f81403cae 100644 --- a/.github/workflows/build-bottles.yml +++ b/.github/workflows/build-bottles.yml @@ -2,8 +2,8 @@ name: Build homebrew bottles on: # Run when a release is tagged push: - tags: - - "v*" + branches: + - "krendelhoff/bottle-workflow" permissions: # Restrict GITHUB_TOKEN permissions contents: write @@ -17,7 +17,7 @@ jobs: matrix: os: [ { id: macos-13, name: "ventura" } ] # we don't bottle meta-formulas that contain only services - formula: [tezos-smart-rollup-wasm-debugger, tezos-smart-rollup-node, tezos-dac-client, tezos-dac-node, tezos-dal-node, tezos-signer, tezos-codec, tezos-client, tezos-admin-client, tezos-node, tezos-accuser-PsQuebec, tezos-baker-PsQuebec, tezos-accuser-PsParisC, tezos-baker-PsParisC] + formula: [tezos-smart-rollup-wasm-debugger] steps: - name: Checkout uses: actions/checkout@v4 @@ -49,49 +49,3 @@ jobs: if: steps.check-built.outcome == 'failure' run: ./scripts/build-one-bottle.sh "${{ matrix.formula }}" timeout-minutes: 120 - - - name: Upload the bottle to Github Actions - if: steps.check-built.outcome == 'failure' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.formula }}-${{ github.run_id }} - path: '*.bottle.*' - - - name: Attach the bottle to the release - if: steps.check-built.outcome == 'failure' - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: gh release upload "${{ env.tag }}" *.bottle.* - - sync-hashes: - runs-on: macos-13 - needs: build-bottles - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install GNU sed - run: | - brew install gnu-sed - echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH - - - name: Install coreutils for macOS # for sha256sum - run: brew install coreutils - - # Since using the tag that triggered the pipeline isn't very resilient, we use the version - # from the tezos-client formula, which hopefully will stay the most up-to-date. - - id: extract-tag - name: Extract the right version from the formula - run: echo "tag=$(sed -n 's/^\s\+version \"\(.*\)\"/\1/p' ./Formula/tezos-client.rb)" >> $GITHUB_ENV - - # It's possible we have had to rerun the building workflow, skipping some jobs and - # erasing the previously built bottles, so we use the release to download them all - - name: Download Ventura bottles from the release - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: gh release download "${{ github.ref_name }}" -p "*.ventura.bottle.tar.gz" -D "./Ventura" - - - name: Add bottle hashes to formulae - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - run: ./scripts/sync-bottle-hashes.sh "${{ github.ref_name }}" "Ventura" diff --git a/Formula/tezos-smart-rollup-wasm-debugger.rb b/Formula/tezos-smart-rollup-wasm-debugger.rb index a5832a3f7..a7922b07b 100644 --- a/Formula/tezos-smart-rollup-wasm-debugger.rb +++ b/Formula/tezos-smart-rollup-wasm-debugger.rb @@ -40,7 +40,8 @@ def make_deps ENV["LDFLAGS"] = "-L#{HOMEBREW_PREFIX}/lib" # Here is the workaround to use opam 2.0.9 because Tezos is currently not compatible with opam 2.1.0 and newer arch = RUBY_PLATFORM.include?("arm64") ? "arm64" : "x86_64" - system "rustup-init", "--default-toolchain", "1.78.0", "-y" + system "xcode-select", "--install" + system "rustup-init", "--default-toolchain", "1.78.0", "-t", "#{arch}-apple-darwin", "-y" system "opam", "init", "--bare", "--debug", "--auto-setup", "--disable-sandboxing" system ["source .cargo/env", "make build-deps"].join(" && ") end @@ -48,7 +49,7 @@ def make_deps def install_template(dune_path, exec_path, name) bin.mkpath self.class.all_bins << name - system ["eval $(opam env)", "dune build #{dune_path}", "cp #{exec_path} #{name}"].join(" && ") + system ["source .cargo/env", "eval $(opam env)", "dune build #{dune_path}", "cp #{exec_path} #{name}"].join(" && ") bin.install name ln_sf "#{bin}/#{name}", "#{bin}/#{name.gsub("octez", "tezos")}" end diff --git a/scripts/build-one-bottle.sh b/scripts/build-one-bottle.sh index d245b3ada..c1f39046d 100755 --- a/scripts/build-one-bottle.sh +++ b/scripts/build-one-bottle.sh @@ -13,7 +13,7 @@ if [ -z "$1" ] ; then fi # shellcheck disable=SC2046 -brew install --formula --build-bottle "./Formula/$1.rb" +brew install -v --formula --build-bottle "./Formula/$1.rb" # Newer brew versions fail when checking for a rebuild version of non-core taps. # So for now we skip the check with '--no-rebuild' brew bottle --force-core-tap --no-rebuild "./Formula/$1.rb"