Skip to content

Commit

Permalink
[TMP]
Browse files Browse the repository at this point in the history
  • Loading branch information
krendelhoff2 committed Nov 30, 2024
1 parent 4e4232e commit ed5df9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 55 deletions.
52 changes: 3 additions & 49 deletions .github/workflows/build-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
10 changes: 5 additions & 5 deletions Formula/tezos-smart-rollup-wasm-debugger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ class << self

def make_deps
ENV.deparallelize
ENV["CARGO_HOME"]="./.cargo"
# ENV["CARGO_HOME"]="./.cargo"
# Disable usage of instructions from the ADX extension to avoid incompatibility
# with old CPUs, see https://gitlab.com/dannywillems/ocaml-bls12-381/-/merge_requests/135/
ENV["BLST_PORTABLE"]="yes"
# Force linker to use libraries from the current brew installation.
# Workaround for https://github.com/serokell/tezos-packaging/issues/700
ENV["LDFLAGS"] = "-L#{HOMEBREW_PREFIX}/lib"
# 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 "rustup-init", "--default-toolchain", "1.78.0", "-y"
system "opam", "init", "--bare", "--debug", "--auto-setup", "--disable-sandboxing"
system ["source .cargo/env", "make build-deps"].join(" && ")
system "make build-deps"
end

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
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-one-bottle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ed5df9d

Please sign in to comment.