Skip to content

Commit

Permalink
Merge pull request #360 from serokell/auto/v12.0-rc1-release
Browse files Browse the repository at this point in the history
[Chore] v12.0-rc1 release
  • Loading branch information
ixahedron authored Dec 22, 2021
2 parents f3f78b7 + 578065c commit 91c5d65
Show file tree
Hide file tree
Showing 42 changed files with 581 additions and 348 deletions.
47 changes: 11 additions & 36 deletions .github/workflows/build-bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,17 @@ permissions:
# Restrict GITHUB_TOKEN permissions
contents: write
jobs:
build-bottles-catalina:
runs-on: macos-10.15
steps:
- name: Install coreutils for macOS # for sha256sum
run: brew install coreutils
build-bottles:
runs-on: ${{ matrix.os }}

- name: Install GNU sed # for the other pipeline compatibility
run: |
brew install gnu-sed
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v2

- name: Build bottles
run: ./scripts/build-bottles.sh

- name: Upload bottles to Github Actions
uses: actions/upload-artifact@v2
with:
name: homebrew-bottles
path: '*.bottle.*'

- name: Add Catalina bottle hashes to formulae
run: ./scripts/sync-bottle-hashes.sh "${GITHUB_REF#refs/tags/}" "Catalina"

- name: Attach bottles to the release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh release upload "${GITHUB_REF#refs/tags/}" *.bottle.*
strategy:
matrix:
include:
- os: macos-10.15
name: "Catalina"
- os: macos-11
name: "Big Sur"

build-bottles-big-sur:
runs-on: macos-11
# Unfortunately there is no convenient way to concatenate lists in YAML :(
# So the entire steps sequence is copy-pasted to use different macOS version as an
# argument in one step
steps:
- name: Install coreutils for macOS # for sha256sum
run: brew install coreutils
Expand All @@ -65,8 +40,8 @@ jobs:
name: homebrew-bottles
path: '*.bottle.*'

- name: Add Big Sur bottle hashes to formulae
run: ./scripts/sync-bottle-hashes.sh "${GITHUB_REF#refs/tags/}" "Big Sur"
- name: Add bottle hashes to formulae
run: ./scripts/sync-bottle-hashes.sh "${GITHUB_REF#refs/tags/}" ${{ matrix.name }}

- name: Attach bottles to the release
env:
Expand Down
7 changes: 2 additions & 5 deletions Formula/tezos-accuser-011-PtHangz2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class << self
end
homepage "https://gitlab.com/tezos/tezos"

url "https://gitlab.com/tezos/tezos.git", :tag => "v11.0+no_adx", :shallow => false
url "https://gitlab.com/tezos/tezos.git", :tag => "v12.0-rc1", :shallow => false

version "v11.0+no_adx-2"
version "v12.0-rc1-1"

build_dependencies = %w[pkg-config autoconf rsync wget rustup-init]
build_dependencies.each do |dependency|
Expand All @@ -27,9 +27,6 @@ class << self

bottle do
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosAccuser011Pthangz2.version}/"
sha256 cellar: :any, big_sur: "593f450e42a0e4504aad356a894eb9e669bf92f00cb742d277485eb65ea25e75"
sha256 cellar: :any, catalina: "9768b456ed9038777524ad432fe10707f627d2f59908af2ca59d12f9a43f4b57"
sha256 cellar: :any, arm64_big_sur: "3a0ebb8a14639388363cfb351dc1018215e8985df4c6fcccc5298c8eb35fedcd"
end

def make_deps
Expand Down
119 changes: 119 additions & 0 deletions Formula/tezos-accuser-012-PsiThaCa.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# SPDX-FileCopyrightText: 2021 TQ Tezos <https://tqtezos.com/>
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ

class TezosAccuser012Psithaca < Formula
@all_bins = []

class << self
attr_accessor :all_bins
end
homepage "https://gitlab.com/tezos/tezos"

url "https://gitlab.com/tezos/tezos.git", :tag => "v12.0-rc1", :shallow => false

version "v12.0-rc1-1"

build_dependencies = %w[pkg-config autoconf rsync wget rustup-init]
build_dependencies.each do |dependency|
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi]
dependencies.each do |dependency|
depends_on dependency
end
desc "Daemon for accusing"

bottle do
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosAccuser012Psithaca.version}/"
end

def make_deps
ENV.deparallelize
ENV["CARGO_HOME"]="./.cargo"
# Here is the workaround to use opam 2.0 because Tezos is currently not compatible with opam 2.1.0 and newer
arch = RUBY_PLATFORM.include?("arm64") ? "arm64" : "x86_64"
system "curl", "-L", "https://github.com/ocaml/opam/releases/download/2.0.9/opam-2.0.9-#{arch}-macos", "--create-dirs", "-o", "#{ENV["HOME"]}/.opam-bin/opam"
system "chmod", "+x", "#{ENV["HOME"]}/.opam-bin/opam"
ENV["PATH"]="#{ENV["HOME"]}/.opam-bin:#{ENV["PATH"]}"
system "rustup-init", "--default-toolchain", "1.52.1", "-y"
system "opam", "init", "--bare", "--debug", "--auto-setup", "--disable-sandboxing"
system ["source .cargo/env", "make build-deps"].join(" && ")
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(" && ")
bin.install name
end

def install
startup_contents =
<<~EOS
#!/usr/bin/env bash
set -euo pipefail
accuser="#{bin}/tezos-accuser-012-PsiThaCa"
accuser_dir="$DATA_DIR"
accuser_config="$accuser_dir/config"
mkdir -p "$accuser_dir"
if [ ! -f "$accuser_config" ]; then
"$accuser" --base-dir "$accuser_dir" \
--endpoint "$NODE_RPC_ENDPOINT" \
config init --output "$accuser_config" >/dev/null 2>&1
else
"$accuser" --base-dir "$accuser_dir" \
--endpoint "$NODE_RPC_ENDPOINT" \
config update >/dev/null 2>&1
fi
exec "$accuser" --base-dir "$accuser_dir" \
--endpoint "$NODE_RPC_ENDPOINT" \
run
EOS
File.write("tezos-accuser-012-PsiThaCa-start", startup_contents)
bin.install "tezos-accuser-012-PsiThaCa-start"
make_deps
install_template "src/proto_012_PsiThaCa/bin_accuser/main_accuser_012_PsiThaCa.exe",
"_build/default/src/proto_012_PsiThaCa/bin_accuser/main_accuser_012_PsiThaCa.exe",
"tezos-accuser-012-PsiThaCa"
end

plist_options manual: "tezos-accuser-012-PsiThaCa run"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>Program</key>
<string>#{opt_bin}/tezos-accuser-012-PsiThaCa-start</string>
<key>EnvironmentVariables</key>
<dict>
<key>DATA_DIR</key>
<string>#{var}/lib/tezos/client</string>
<key>NODE_RPC_ENDPOINT</key>
<string>http://localhost:8732</string>
</dict>
<key>RunAtLoad</key><true/>
<key>StandardOutPath</key>
<string>#{var}/log/#{name}.log</string>
<key>StandardErrorPath</key>
<string>#{var}/log/#{name}.log</string>
</dict>
</plist>
EOS
end
def post_install
mkdir "#{var}/lib/tezos/client"
end
end
7 changes: 2 additions & 5 deletions Formula/tezos-admin-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class << self
end
homepage "https://gitlab.com/tezos/tezos"

url "https://gitlab.com/tezos/tezos.git", :tag => "v11.0+no_adx", :shallow => false
url "https://gitlab.com/tezos/tezos.git", :tag => "v12.0-rc1", :shallow => false

version "v11.0+no_adx-2"
version "v12.0-rc1-1"

build_dependencies = %w[pkg-config autoconf rsync wget rustup-init]
build_dependencies.each do |dependency|
Expand All @@ -27,9 +27,6 @@ class << self

bottle do
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosAdminClient.version}/"
sha256 cellar: :any, big_sur: "60e55758144dfb9599b25994289d0b74d5d51468fb7af8b8eedb14bb143879fa"
sha256 cellar: :any, catalina: "a7337ef84fcab489b6043d91f0c34a42d249b0d4a2b4fe062b9787af6c34c1ab"
sha256 cellar: :any, arm64_big_sur: "21e4ecc0f2a7efa1c39496eab4994a79e023f8842ec3292c2d34ce1631b09b80"
end

def make_deps
Expand Down
7 changes: 2 additions & 5 deletions Formula/tezos-baker-011-PtHangz2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class << self
end
homepage "https://gitlab.com/tezos/tezos"

url "https://gitlab.com/tezos/tezos.git", :tag => "v11.0+no_adx", :shallow => false
url "https://gitlab.com/tezos/tezos.git", :tag => "v12.0-rc1", :shallow => false

version "v11.0+no_adx-2"
version "v12.0-rc1-1"

build_dependencies = %w[pkg-config autoconf rsync wget rustup-init]
build_dependencies.each do |dependency|
Expand All @@ -27,9 +27,6 @@ class << self

bottle do
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosBaker011Pthangz2.version}/"
sha256 cellar: :any, big_sur: "0e5ba12753889bbaa83d352cd0e44a06f9bed527a7d194f77e747690ed351e94"
sha256 cellar: :any, catalina: "a981a4dcd41724e24c38f5955580e376b971a029782ddd3332ce1bb9b125749b"
sha256 cellar: :any, arm64_big_sur: "3b39a23891be243f66b4eed5b1c40239db3aab60b9273dad0945be2742457981"
end

def make_deps
Expand Down
130 changes: 130 additions & 0 deletions Formula/tezos-baker-012-PsiThaCa.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# SPDX-FileCopyrightText: 2021 TQ Tezos <https://tqtezos.com/>
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ

class TezosBaker012Psithaca < Formula
@all_bins = []

class << self
attr_accessor :all_bins
end
homepage "https://gitlab.com/tezos/tezos"

url "https://gitlab.com/tezos/tezos.git", :tag => "v12.0-rc1", :shallow => false

version "v12.0-rc1-1"

build_dependencies = %w[pkg-config autoconf rsync wget rustup-init]
build_dependencies.each do |dependency|
depends_on dependency => :build
end

dependencies = %w[gmp hidapi libev libffi tezos-sapling-params]
dependencies.each do |dependency|
depends_on dependency
end
desc "Daemon for baking"

bottle do
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosBaker012Psithaca.version}/"
end

def make_deps
ENV.deparallelize
ENV["CARGO_HOME"]="./.cargo"
# 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 "curl", "-L", "https://github.com/ocaml/opam/releases/download/2.0.9/opam-2.0.9-#{arch}-macos", "--create-dirs", "-o", "#{ENV["HOME"]}/.opam-bin/opam"
system "chmod", "+x", "#{ENV["HOME"]}/.opam-bin/opam"
ENV["PATH"]="#{ENV["HOME"]}/.opam-bin:#{ENV["PATH"]}"
system "rustup-init", "--default-toolchain", "1.52.1", "-y"
system "opam", "init", "--bare", "--debug", "--auto-setup", "--disable-sandboxing"
system ["source .cargo/env", "make build-deps"].join(" && ")
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(" && ")
bin.install name
end

def install
startup_contents =
<<~EOS
#!/usr/bin/env bash
set -euo pipefail
baker="#{bin}/tezos-baker-012-PsiThaCa"
baker_dir="$DATA_DIR"
baker_config="$baker_dir/config"
mkdir -p "$baker_dir"
if [ ! -f "$baker_config" ]; then
"$baker" --base-dir "$baker_dir" \
--endpoint "$NODE_RPC_ENDPOINT" \
config init --output "$baker_config" >/dev/null 2>&1
else
"$baker" --base-dir "$baker_dir" \
--endpoint "$NODE_RPC_ENDPOINT" \
config update >/dev/null 2>&1
fi
launch_baker() {
exec "$baker" \
--base-dir "$baker_dir" --endpoint "$NODE_RPC_ENDPOINT" \
run with local node "$NODE_DATA_DIR" "$@"
}
if [[ -z "$BAKER_ACCOUNT" ]]; then
launch_baker
else
launch_baker "$BAKER_ACCOUNT"
fi
EOS
File.write("tezos-baker-012-PsiThaCa-start", startup_contents)
bin.install "tezos-baker-012-PsiThaCa-start"
make_deps
install_template "src/proto_012_PsiThaCa/bin_baker/main_baker_012_PsiThaCa.exe",
"_build/default/src/proto_012_PsiThaCa/bin_baker/main_baker_012_PsiThaCa.exe",
"tezos-baker-012-PsiThaCa"
end
plist_options manual: "tezos-baker-012-PsiThaCa run with local node"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>Program</key>
<string>#{opt_bin}/tezos-baker-012-PsiThaCa-start</string>
<key>EnvironmentVariables</key>
<dict>
<key>DATA_DIR</key>
<string>#{var}/lib/tezos/client</string>
<key>NODE_DATA_DIR</key>
<string></string>
<key>NODE_RPC_ENDPOINT</key>
<string>http://localhost:8732</string>
<key>BAKER_ACCOUNT</key>
<string></string>
</dict>
<key>RunAtLoad</key><true/>
<key>StandardOutPath</key>
<string>#{var}/log/#{name}.log</string>
<key>StandardErrorPath</key>
<string>#{var}/log/#{name}.log</string>
</dict>
</plist>
EOS
end
def post_install
mkdir "#{var}/lib/tezos/client"
end
end
Loading

0 comments on commit 91c5d65

Please sign in to comment.