Skip to content

Commit

Permalink
tmp-release-test
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqu4le committed Sep 7, 2023
1 parent 920f317 commit 5401bab
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 127 deletions.
150 changes: 44 additions & 106 deletions .buildkite/pipeline-for-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,10 @@ env:


steps:
- label: Check for new Octez release
if: build.source == "schedule" && build.branch == "master"
commands:
- nix develop .#autorelease -c ./scripts/update-tezos.sh

- label: Build ubuntu source packages
key: build-ubuntu-source-packages
if: build.tag =~ /^v.*-1/
agents:
queue: "docker"
commands:
- eval "$SET_VERSION"
- nix develop .#docker-tezos-packages -c ./docker/build/ubuntu/build.py --type source
artifact_paths:
- ./out/*

- label: Build fedora source packages
key: build-fedora-source-packages
if: build.tag =~ /^v.*-1/
agents:
queue: "docker"
commands:
- eval "$SET_VERSION"
- nix develop .#docker-tezos-packages -c ./docker/build/fedora/build.py --type source
artifact_paths:
- ./out/*

- label: Sign ubuntu source packages
if: build.tag =~ /^v.*-1/
depends_on:
- "build-ubuntu-source-packages"
key: sign-ubuntu-source-packages
commands:
- eval "$SET_VERSION"
- buildkite-agent artifact download "out/*" . --step build-ubuntu-source-packages
- nix develop .#docker-tezos-packages -c ./docker/build/ubuntu/sign.py -d out -i 'Serokell <[email protected]>'
artifact_paths:
- ./out/*

- label: Sign fedora source packages
if: build.tag =~ /^v.*-1/
depends_on:
- "build-fedora-source-packages"
key: sign-fedora-source-packages
commands:
- eval "$SET_VERSION"
- buildkite-agent artifact download "out/*" . --step build-fedora-source-packages
- nix develop .#docker-tezos-packages -c ./docker/build/fedora/sign.py -d out -i 'Serokell <[email protected]>'
artifact_paths:
- ./out/*

- label: Publish ubuntu native packages
if: build.tag =~ /^v.*-1/
depends_on:
- "sign-ubuntu-source-packages"
commands:
- eval "$SET_VERSION"
- buildkite-agent artifact download "out/*" . --step sign-ubuntu-source-packages
- nix develop .#buildkite -c ./docker/build/ubuntu/upload.py -d out

- label: Publish fedora native packages
if: build.tag =~ /^v.*-1/
depends_on:
- "sign-fedora-source-packages"
commands:
- eval "$SET_VERSION"
- buildkite-agent artifact download "out/*" . --step sign-fedora-source-packages
- nix develop .#buildkite -c ./docker/build/fedora/upload.py -d out

- label: build-via-docker
if: build.tag =~ /^v.*-1/
# this step is used as a dependency, so we're defining 'key' explicitely
key: build-via-docker
if: build.tag == "test-695"
commands:
- eval "$SET_VERSION"
- cd docker
Expand All @@ -89,46 +21,42 @@ steps:
agents:
queue: "docker"

- label: Build source packages from static binaries
key: build-source-packages-from-static-binaries
if: build.tag =~ /^v.*-1/
agents:
queue: "docker"
depends_on:
- "build-via-docker"
- label: build-arm-via-docker
# this step is used as a dependency, so we're defining 'key' explicitely
key: build-arm-via-docker
if: build.tag == "test-695"
commands:
- eval "$SET_VERSION"
- mkdir binaries
- buildkite-agent artifact download "docker/*" binaries --step build-via-docker
- nix develop .#docker-tezos-packages -c ./docker/build/fedora/build.py --type source --output-dir epel --binaries-dir ./binaries/docker
- cd docker
- ./docker-static-build.sh
- >
for f in ./octez-*; do
mv "\$f" "\$f-arm64"
done
artifact_paths:
- ./epel/*
- ./docker/octez-*
agents:
queue: "arm64-darwin"

- label: Sign source packages built from static binaries
key: sign-source-packages-built-from-static-binaries
if: build.tag =~ /^v.*-1/
depends_on:
- "build-source-packages-from-static-binaries"
- label: create auto release/pre-release
key: auto-release
if: build.tag == "test-695"
commands:
- eval "$SET_VERSION"
- buildkite-agent artifact download "epel/*" . --step build-source-packages-from-static-binaries
- nix develop .#docker-tezos-packages -c ./docker/build/fedora/sign.py -d epel -i 'Serokell <[email protected]>'
artifact_paths:
- ./epel/*

- label: Publish epel packages
if: build.tag =~ /^v.*-1/
- mkdir binaries
- mkdir arm-binaries
- buildkite-agent artifact download "docker/*" binaries --step "build-via-docker"
- buildkite-agent artifact download "docker/*" arm-binaries --step "build-arm-via-docker"
- ls binaries
- nix develop .#autorelease -c ./scripts/autorelease.sh "$BUILDKITE_MESSAGE"
depends_on:
- "sign-source-packages-built-from-static-binaries"
commands:
- eval "$SET_VERSION"
- mkdir -p srcs
- buildkite-agent artifact download "epel/*" srcs --step sign-source-packages-built-from-static-binaries
- nix develop .#buildkite -c ./docker/build/fedora/upload.py -d srcs/epel --upload epel
- "build-via-docker"
- "build-arm-via-docker"

- label: Build Big Sur x86_64 bottles
key: build-bottles-big-sur-x86_64
if: build.tag =~ /^v.*/
if: build.tag == "test-695"
depends_on:
- "auto-release"
agents:
queue: "x86_64-rosetta-darwin"
commands:
Expand All @@ -141,7 +69,9 @@ steps:

- label: Build Big Sur arm64 bottles
key: build-bottles-big-sur-arm64
if: build.tag =~ /^v.*/
if: build.tag == "test-695"
depends_on:
- "auto-release"
agents:
queue: "arm64-darwin"
commands:
Expand All @@ -152,15 +82,23 @@ steps:
automatic:
limit: 1

# We use the tag that triggered the pipeline here. Normally, this isn't very resilient,
# but in 'scripts/sync-bottle-hashes.sh' it's only used for informational purposes
- label: Add Big Sur bottle hashes to formulae
key: list-bottles
depends_on:
- "build-bottles-big-sur-arm64"
- "build-bottles-big-sur-x86_64"
if: build.tag =~ /^v.*/
if: build.tag == "test-695"
soft_fail: true # No artifacts to download if all the bottles are already built
commands:
- mkdir -p "Big Sur"
- gh release download build.tag -D "Big Sur/" -p "*.bottle.tar.gz"
- nix develop .#autorelease -c ./scripts/sync-bottle-hashes.sh "$BUILDKITE_TAG" "Big Sur"
- ls "Big Sur"

- label: delete test-release pre-release
commands:
- nix develop .#autorelease -c ./scripts/del-test-release.sh "$BUILDKITE_MESSAGE"
if: build.tag == "test-695"
depends_on:
- "build-bottles-big-sur-x86_64"
- "build-bottles-big-sur-arm64"
- "list-bottles"
13 changes: 1 addition & 12 deletions scripts/autorelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,7 @@ rc_regex="^v[0-9]+\.[0-9]+-(rc|beta)[0-9]+"

# We create a pre-release in any case except if we are merging a stable version release PR
mode_flag="--prerelease"

if [[ ${1-""} =~ $msg_regex ]]; then
tag="${BASH_REMATCH[1]}-$(jq -r '.release' meta.json)"
if [[ ! $tag =~ $rc_regex ]]; then
mode_flag=""
fi
else
tag="auto-release"

# Delete autorelease if it exists
gh release delete auto-release --yes || true
fi
tag="test-release"

# Update the tag
git fetch # So that the script can be run from an arbitrary checkout
Expand Down
14 changes: 6 additions & 8 deletions scripts/build-all-bottles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -euo pipefail
retval="0"

# we don't bottle meta-formulas that contain only services
formulae=("tezos-accuser-PtMumbai" "tezos-accuser-PtNairob" "tezos-admin-client" "tezos-baker-PtMumbai" "tezos-baker-PtNairob" "tezos-client" "tezos-codec" "tezos-node" "tezos-signer" "tezos-smart-rollup-client-PtMumbai" "tezos-smart-rollup-client-PtNairob" "tezos-smart-rollup-node-PtMumbai" "tezos-smart-rollup-node-PtNairob")
formulae=("tezos-client")

# tezos-sapling-params is used as a dependency for some of the formulas
# so we handle it separately.
Expand All @@ -31,13 +31,11 @@ for f in "${formulae[@]}"; do
if ./scripts/check-bottle-built.sh "$f" "$1"; then
# build a bottle
if ./scripts/build-one-bottle.sh "$f"; then
# upload the bottle to its respective release
FORMULA_TAG="$(sed -n "s/^\s\+version \"\(.*\)\"/\1/p" "./Formula/$f.rb")"
if ! gh release upload "$FORMULA_TAG" "$f"*.bottle.*; then
# we want a non-0 exit code if any of the bottles couldn't be uploaded
retval="1";
>&2 echo "Bottle for $f couldn't be uploaded to $FORMULA_TAG release."
fi
# upload the bottle to the test release
gh release upload "test-release" "$f"*.bottle.*
# we want a non-0 exit code if the bottle was uploaded, to simulate a failure
retval="1";
>&2 echo "Bottle for $f was now uploaded to test-release."
else
# we want a non-0 exit code if any of the bottles couldn't be built
retval="1";
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-bottle-built.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ ! -f "./Formula/$1.rb" ] ; then
exit 2
fi

tag=$(sed -n "s/^\s\+version \"\(.*\)\"/\1/p" "./Formula/$1.rb")
tag="test-release"

set +e

Expand Down
8 changes: 8 additions & 0 deletions scripts/del-test-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# shellcheck shell=bash
# SPDX-FileCopyrightText: 2023 Oxhead Alpha
# SPDX-License-Identifier: LicenseRef-MIT-OA

set -euo pipefail

gh release delete test-release --yes || true

0 comments on commit 5401bab

Please sign in to comment.