-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a the "Add release commits" step
- Loading branch information
Github Action
committed
Jun 12, 2024
1 parent
f3d0fdb
commit 9087af6
Showing
3 changed files
with
40 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#! /usr/bin/env bash | ||
#! /usr/bin/env -S nix shell '.#cardano-node' 'nixpkgs#gnused' --command bash | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
set -euox pipefail | ||
|
||
# date from git tag | ||
# example v2023-04-04 -> 2023-04-04 | ||
|
@@ -13,11 +14,7 @@ tag_cabal_ver() { | |
tag_date "$1" | sed -e s/-0/-/g -e s/-/./g | ||
} | ||
|
||
BASE_COMMIT=$(curl -X GET -H "Authorization: Bearer ${BUILDKITE_API_TOKEN}" \ | ||
"https://api.buildkite.com/v2/organizations/cardano-foundation/pipelines/cardano-wallet/builds" \ | ||
| jq -r \ | ||
'[.[] | select(.state == "passed" and .branch == "master") | .commit][0]') | ||
|
||
BASE_COMMIT=$(git rev-parse HEAD) | ||
echo "BASE_COMMIT=$BASE_COMMIT" | ||
|
||
today=$(date +%Y-%m-%d) | ||
|
@@ -34,25 +31,31 @@ echo "OLD_GIT_TAG=$OLD_GIT_TAG" | |
OLD_CABAL_VERSION=$(tag_cabal_ver "$OLD_GIT_TAG") | ||
echo "OLD_CABAL_VERSION=$OLD_CABAL_VERSION" | ||
|
||
CARDANO_NODE_TAG="8.9.3" | ||
CARDANO_NODE_TAG=$(cardano-node version | head -n1 | awk '{print $2}') | ||
echo "CARDANO_NODE_TAG=$CARDANO_NODE_TAG" | ||
|
||
git checkout "$BASE_COMMIT" | ||
RELEASE_CANDIDATE_BRANCH="release-candidate-new/$NEW_GIT_TAG" | ||
echo "RELEASE_CANDIDATE_BRANCH=$RELEASE_CANDIDATE_BRANCH" | ||
|
||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Action" | ||
|
||
git checkout -b release-candidate/"$NEW_GIT_TAG" || true | ||
git branch -D "$RELEASE_CANDIDATE_BRANCH" || true | ||
git checkout -b "$RELEASE_CANDIDATE_BRANCH" || true | ||
|
||
sed -i "s|version: .*|version: $NEW_GIT_TAG|" specifications/api/swagger.yaml | ||
sed -i "s|version: .*|version: $NEW_GIT_TAG|g" specifications/api/swagger.yaml | ||
git commit -m "Update wallet version in swagger.yaml" specifications/api/swagger.yaml | ||
|
||
git ls-files '*.cabal' | xargs sed -i "s/$OLD_CABAL_VERSION/$NEW_CABAL_VERSION/" | ||
git ls-files '*.cabal' | xargs sed -i "s|$OLD_CABAL_VERSION|$NEW_CABAL_VERSION|g" | ||
git commit -am "Update cardano-wallet version in *.cabal files" | ||
|
||
sed -i "s|NODE_TAG=.*|NODE_TAG=$CARDANO_NODE_TAG|" README.md | ||
sed -i "s|WALLET_TAG=.*|WALLET_TAG=$NEW_CABAL_VERSION|" README.md | ||
sed -i "s|WALLET_VERSION=.*|WALLET_VERSION=$NEW_GIT_TAG|" README.md | ||
sed -i "s|NODE_TAG=.*|NODE_TAG=$CARDANO_NODE_TAG|g" README.md | ||
sed -i "s|WALLET_TAG=.*|WALLET_TAG=$NEW_CABAL_VERSION|g" README.md | ||
sed -i "s|WALLET_VERSION=.*|WALLET_VERSION=$NEW_GIT_TAG|g" README.md | ||
git commit -am "Update cardano-wallet version in README.md" | ||
|
||
git push -f origin release-candidate/"$NEW_GIT_TAG" | ||
RELEASE_COMMIT=$(git rev-parse HEAD) | ||
echo "RELEASE_COMMIT=$RELEASE_COMMIT" | ||
|
||
echo ${GITHUB_TOKEN:0:4} | ||
git push -f origin "$RELEASE_CANDIDATE_BRANCH" |