Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable rc dockerhub publish in await-release script #4100

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
if: needs.tag.outputs.is_rc == 'true'
steps:
- uses: actions/checkout@v2
- run: scripts/await-release.sh ${{ needs.tag.outputs.tag }} 900
- run: scripts/await-release.sh ${{ needs.tag.outputs.tag }} rc 900
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
if: needs.tag.outputs.is_stable == 'true'
steps:
- uses: actions/checkout@v2
- run: scripts/await-release.sh ${{ needs.tag.outputs.tag }} 900
- run: scripts/await-release.sh ${{ needs.tag.outputs.tag }} latest 900
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
11 changes: 6 additions & 5 deletions scripts/await-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ declare PACKAGE="@chainsafe/lodestar-cli"
# Using `npm view -j` to get all available versions as JSON
declare CMD_NPM="npm view -j $PACKAGE"

# Using `jq` to get the latest version
declare VERSION_LATEST=$($CMD_NPM | jq -r '."dist-tags".latest')
# Using `jq` to get the dist-tag version
declare VERSION_LATEST=$($CMD_NPM | jq -r ".\"dist-tags\".$DIST_TAG")

# Usage: scripts/await-release.sh $VERSION $TIMEOUT
declare VERSION_EXPECTED=$(echo $1 | tr -d 'v')
declare TIMEOUT=$2
declare DIST_TAG=$2
declare TIMEOUT=$3

declare TIME=0
declare SLEEP=5
Expand All @@ -23,7 +24,7 @@ declare SLEEP=5
### Note: that this script will already exit here in case everything is fine
### and only delay in case there is a discrepancy between the versions
while [[ "$VERSION_EXPECTED" != "$VERSION_LATEST" ]]; do
echo "Expected version $VERSION_EXPECTED does not match latest version $VERSION_LATEST in NPM registry. Trying again in $SLEEP..."
echo "Expected version $VERSION_EXPECTED does not match $DIST_TAG version $VERSION_LATEST in NPM registry. Trying again in $SLEEP..."
TIME=$(($TIME+$SLEEP))

# Allow the CI to timeout
Expand All @@ -35,5 +36,5 @@ while [[ "$VERSION_EXPECTED" != "$VERSION_LATEST" ]]; do

# Force clean cache before retrying
npm cache clean --force
VERSION_LATEST=$($CMD_NPM | jq -r '."dist-tags".latest')
VERSION_LATEST=$($CMD_NPM | jq -r ".\"dist-tags\".$DIST_TAG")
done