-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This PR remove some manual steps from the release process. In particular - create release tag - create release - upload artifacts - upload the titles and links of the PRs since last release, for further human processing Because the release process is rare, this PR introduce a running draft release called nightly, which runs the automated steps on a running tag that gets rewritten every day. More work should be done to - collect automatically the dockerhub image link. - collect the bump.sh to the current change ADP-3400
- Loading branch information
Showing
12 changed files
with
286 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
since_date="$(buildkite-agent meta-data get last-release-date)" | ||
|
||
fetch_prs() { | ||
curl --silent \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/search/issues?q=repo:cardano-foundation/cardano-wallet+is:pr+is:merged+merged:%3E$since_date" | ||
} | ||
|
||
prs=$(fetch_prs | jq '.items | map({date:.pull_request.merged_at | split("T")[0], number:.number,title:.title,labels:.labels| map(.name),author:.user.login })') | ||
|
||
items=$(jq 'map("\(.date), #\(.number), \(.author), \(.labels | join(", ")), \(.title)")' <<< "$prs") | ||
item_max=$(jq 'length - 1' <<< "$items") | ||
|
||
mkdir -p artifacts | ||
|
||
for i in $(seq 0 "$item_max"); do | ||
item=$(jq -r ".[$i]" <<< "$items") | ||
echo "$item" \ | ||
| sed -E 's,\[(ADP\-[0-9]+)\],[\1](https://cardanofoundation.atlassian.net/browse/\1),g' \ | ||
| sed -E 's,\[ADP-x+\],,g' \ | ||
| sed -E 's,#([0-9]+),[#\1](https://github.com/cardano-foundation/cardano-wallet/pull/\1),g' \ | ||
>> artifacts/changes.md | ||
done |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euox pipefail | ||
|
||
base_build=$(buildkite-agent meta-data get base-build) | ||
NEW_GIT_TAG=$(buildkite-agent meta-data get release-version) | ||
|
||
if [ "$RELEASE" == "false" ]; then | ||
TAG=nightly | ||
else | ||
TAG=$NEW_GIT_TAG | ||
fi | ||
|
||
main_build=$(curl -H "Authorization: Bearer $BUILDKITE_API_TOKEN" \ | ||
-X GET "https://api.buildkite.com/v2/builds" \ | ||
| jq ".[] | select(.meta_data.\"triggered-by\" == \"$base_build\")" \ | ||
| jq .number) | ||
|
||
mkdir -p artifacts | ||
|
||
artifact() { | ||
local artifact_name=$1 | ||
# shellcheck disable=SC2155 | ||
local artifact_value=$(curl -H "Authorization: Bearer $BUILDKITE_API_TOKEN" \ | ||
-X GET "https://api.buildkite.com/v2/organizations/cardano-foundation/pipelines/cardano-wallet/builds/$main_build/artifacts" \ | ||
| jq -r ".[] | select(.filename == \"$artifact_name\") \ | ||
| .download_url") | ||
curl -H "Authorization: Bearer $BUILDKITE_API_TOKEN" -L \ | ||
-o "artifacts/$artifact_name" \ | ||
"$artifact_value" | ||
gh release upload "$TAG" "artifacts/$artifact_name" | ||
} | ||
|
||
artifact "cardano-wallet-$NEW_GIT_TAG-linux64.tar.gz" | ||
artifact "cardano-wallet.exe-$NEW_GIT_TAG-win64.zip" | ||
artifact "cardano-wallet-$NEW_GIT_TAG-macos-silicon.tar.gz" | ||
artifact "cardano-wallet-$NEW_GIT_TAG-macos-intel.tar.gz" | ||
artifact "cardano-wallet-$NEW_GIT_TAG-docker-image.tgz" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euox pipefail | ||
|
||
NEW_GIT_TAG=$(buildkite-agent meta-data get release-version) | ||
|
||
if [ "$RELEASE" == "false" ]; then | ||
TAG=nightly | ||
title="Nightly $NEW_GIT_TAG" | ||
else | ||
TAG=$NEW_GIT_TAG | ||
title="Release $TAG" | ||
fi | ||
|
||
buildkite-agent artifact download artifacts/changes.md . | ||
# shellcheck disable=SC2155 | ||
export CHANGES=$(cat artifacts/changes.md) | ||
|
||
# shellcheck disable=SC2155 | ||
export NODE_TAG=$(buildkite-agent meta-data get node-tag) | ||
|
||
# shellcheck disable=SC2034 | ||
export BUMP_CHANGES=xxx | ||
|
||
# shellcheck disable=SC2034 | ||
export DOCKER_SHA=xxx | ||
|
||
# shellcheck disable=SC2016 | ||
envsubst \ | ||
< "$RELEASE_SCRIPTS_DIR/release-template.md" \ | ||
> "$RELEASE_SCRIPTS_DIR/release-template-final.md" | ||
|
||
if [ "$RELEASE" == "false" ]; then | ||
gh release delete nightly --yes || true | ||
fi | ||
|
||
gh release create \ | ||
-d \ | ||
-F "$RELEASE_SCRIPTS_DIR/release-template-final.md" \ | ||
-t "$title" \ | ||
"$TAG" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euox pipefail | ||
|
||
RELEASE_GIT_COMMIT=$(buildkite-agent meta-data get release-candidate-commit) | ||
|
||
git tag -l | xargs git tag -d | ||
git fetch --tags | ||
|
||
if [ "$RELEASE" == "false" ]; then | ||
git tag -d nightly || true | ||
TAG=nightly | ||
else | ||
TAG=$(buildkite-agent meta-data get release-version) | ||
exists=$(git tag -l "$TAG") | ||
if [ -n "$exists" ]; then | ||
echo "Tag $TAG already exists. Remove it before proceeding." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
git tag -m "$TAG" "$TAG" "$RELEASE_GIT_COMMIT" | ||
|
||
git remote set-url origin "https://$GITHUB_TOKEN@github.com/cardano-foundation/cardano-wallet.git" | ||
|
||
git push origin -f "$TAG" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#! /bin/bash | ||
#! /usr/bin/env bash | ||
|
||
set -euox pipefail | ||
|
||
|
This file contains 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
Oops, something went wrong.