-
Notifications
You must be signed in to change notification settings - Fork 213
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
- [x] Remove unused rc-latest GH workflow - [x] Add a `release-candidate.sh` script that - Search for last green CI-1 build on master - Forks a branch named `release-candidate/v\<YYYY-MM-DD\>` with today's date - Add release tweaks (version bumps) - Pushes the new branch to origin - [x] Create a release-candidate fork github workflow that forks every day at 20:00 and run the `release-candidate.sh` script - [x] Remove the release table in `README.md` as difficult to keep update. The link to the releases is preserved. ADP-3237
- Loading branch information
Showing
4 changed files
with
77 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
name: Release candidate daily fork | ||
on: | ||
schedule: | ||
- cron: '0 20 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4.1.1 | ||
with: | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
- run: ./scripts/release-candidate.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} |
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,58 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# date from git tag | ||
# example v2023-04-04 -> 2023-04-04 | ||
tag_date() { | ||
echo "${1##v}" | ||
} | ||
# cabal version from git tag | ||
# example v2023-04-04 -> 2023.4.4 | ||
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]') | ||
|
||
echo "BASE_COMMIT=$BASE_COMMIT" | ||
|
||
today=$(date +%Y-%m-%d) | ||
|
||
NEW_GIT_TAG=v$today | ||
echo "NEW_GIT_TAG=$NEW_GIT_TAG" | ||
|
||
NEW_CABAL_VERSION=$(tag_cabal_ver "$NEW_GIT_TAG") | ||
echo "NEW_CABAL_VERSION=$NEW_CABAL_VERSION" | ||
|
||
OLD_GIT_TAG=$( git tag -l "v2*-*-*" | sort | tail -n1) | ||
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.1.2" | ||
echo "CARDANO_NODE_TAG=$CARDANO_NODE_TAG" | ||
|
||
git checkout "$BASE_COMMIT" | ||
|
||
git config --global user.email "gha@cardanofoundation.org" | ||
git config --global user.name "Github Action" | ||
|
||
git checkout -b release-candidate/"$NEW_GIT_TAG" || true | ||
|
||
sed -i "s|version: .*|version: $NEW_GIT_TAG|" 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 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 | ||
git commit -am "Update cardano-wallet version in README.md" | ||
|
||
git push -f origin release-candidate/"$NEW_GIT_TAG" |