chore: add version bump script (#10871)

kf/feat/rework-indices
Victor Baranov 2 months ago committed by GitHub
parent c876863008
commit e162362431
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/pre-release-arbitrum.yml
  2. 2
      .github/workflows/pre-release-blackfort.yml
  3. 2
      .github/workflows/pre-release-celo.yml
  4. 2
      .github/workflows/pre-release-eth.yml
  5. 2
      .github/workflows/pre-release-optimism.yml
  6. 2
      .github/workflows/pre-release-redstone.yml
  7. 2
      .github/workflows/pre-release-shibarium.yml
  8. 2
      .github/workflows/pre-release-zksync.yml
  9. 2
      .github/workflows/pre-release.yml
  10. 2
      .github/workflows/publish-docker-image-every-push.yml
  11. 2
      .github/workflows/publish-docker-image-for-arbitrum.yml
  12. 2
      .github/workflows/publish-docker-image-for-blackfort.yml
  13. 2
      .github/workflows/publish-docker-image-for-celo.yml
  14. 2
      .github/workflows/publish-docker-image-for-core.yml
  15. 2
      .github/workflows/publish-docker-image-for-eth-sepolia.yml
  16. 2
      .github/workflows/publish-docker-image-for-eth.yml
  17. 2
      .github/workflows/publish-docker-image-for-filecoin.yml
  18. 2
      .github/workflows/publish-docker-image-for-fuse.yml
  19. 2
      .github/workflows/publish-docker-image-for-gnosis-chain.yml
  20. 2
      .github/workflows/publish-docker-image-for-l2-staging.yml
  21. 2
      .github/workflows/publish-docker-image-for-lukso.yml
  22. 2
      .github/workflows/publish-docker-image-for-optimism.yml
  23. 2
      .github/workflows/publish-docker-image-for-polygon-edge.yml
  24. 2
      .github/workflows/publish-docker-image-for-redstone.yml
  25. 2
      .github/workflows/publish-docker-image-for-rootstock.yml
  26. 2
      .github/workflows/publish-docker-image-for-shibarium.yml
  27. 2
      .github/workflows/publish-docker-image-for-stability.yml
  28. 2
      .github/workflows/publish-docker-image-for-suave.yml
  29. 2
      .github/workflows/publish-docker-image-for-zetachain.yml
  30. 2
      .github/workflows/publish-docker-image-for-zkevm.yml
  31. 2
      .github/workflows/publish-docker-image-for-zksync.yml
  32. 2
      .github/workflows/publish-docker-image-staging-on-demand.yml
  33. 2
      .github/workflows/publish-regular-docker-image-on-demand.yml
  34. 2
      .github/workflows/release-arbitrum.yml
  35. 2
      .github/workflows/release-blackfort.yml
  36. 2
      .github/workflows/release-celo.yml
  37. 2
      .github/workflows/release-eth.yml
  38. 2
      .github/workflows/release-filecoin.yml
  39. 2
      .github/workflows/release-fuse.yml
  40. 2
      .github/workflows/release-gnosis.yml
  41. 2
      .github/workflows/release-optimism.yml
  42. 2
      .github/workflows/release-polygon-edge.yml
  43. 2
      .github/workflows/release-polygon-zkevm.yml
  44. 2
      .github/workflows/release-redstone.yml
  45. 2
      .github/workflows/release-rootstock.yml
  46. 2
      .github/workflows/release-shibarium.yml
  47. 2
      .github/workflows/release-stability.yml
  48. 2
      .github/workflows/release-suave.yml
  49. 2
      .github/workflows/release-zetachain.yml
  50. 2
      .github/workflows/release-zksync.yml
  51. 2
      .github/workflows/release.yml
  52. 76
      bin/version_bump.sh

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -16,7 +16,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -11,7 +11,7 @@ on:
env:
OTP_VERSION: ${{ vars.OTP_VERSION }}
ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION }}
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
jobs:
push_to_registry:

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: arbitrum
steps:
- uses: actions/checkout@v4

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: blackfort
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: celo
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: poa
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: eth-sepolia
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: mainnet
steps:
- uses: actions/checkout@v4

@ -9,7 +9,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: filecoin
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: fuse
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: xdai
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: optimism-l2-advanced
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: lukso
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: optimism
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: polygon-edge
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: redstone
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: rsk
steps:
- uses: actions/checkout@v4

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: shibarium
steps:
- uses: actions/checkout@v4

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: stability
steps:
- uses: actions/checkout@v4

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: suave
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: zetachain
steps:
- uses: actions/checkout@v4

@ -10,7 +10,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: zkevm
steps:
- uses: actions/checkout@v4

@ -9,7 +9,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
DOCKER_CHAIN_NAME: zksync
steps:
- uses: actions/checkout@v4

@ -12,7 +12,7 @@ on:
env:
OTP_VERSION: ${{ vars.OTP_VERSION }}
ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION }}
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
jobs:
push_to_registry:

@ -5,7 +5,7 @@ on:
env:
OTP_VERSION: ${{ vars.OTP_VERSION }}
ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION }}
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
jobs:
push_to_registry:

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -13,7 +13,7 @@ jobs:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
RELEASE_VERSION: 6.8.1
steps:
- uses: actions/checkout@v4
- name: Setup repo

@ -0,0 +1,76 @@
#!/bin/bash
# Path to the mix.exs file
MIX_FILES=(
"$(pwd)/mix.exs"
"$(pwd)/apps/block_scout_web/mix.exs"
"$(pwd)/apps/explorer/mix.exs"
"$(pwd)/apps/indexer/mix.exs"
"$(pwd)/apps/ethereum_jsonrpc/mix.exs"
)
CONFIG_FILE="$(pwd)/rel/config.exs"
DOCKER_COMPOSE_FILE="$(pwd)/docker-compose/docker-compose.yml"
MAKE_FILE="$(pwd)/docker/Makefile"
WORKFLOW_FILES=($(find "$(pwd)/.github/workflows" -type f \( -name "pre-release-*" -o -name "release-*" -o -name "publish-docker-image-*" \)))
# Function to bump version
bump_version() {
local type=$1
local custom_version=$2
# Extract the current version
MIX_FILE="${MIX_FILES[0]}"
current_version=$(grep -o 'version: "[0-9]\+\.[0-9]\+\.[0-9]\+"' "$MIX_FILE" | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
echo "Current version: $current_version"
# Split the version into its components
IFS='.' read -r -a version_parts <<< "$current_version"
# Check if the --patch flag is provided
if [[ "$type" == "--patch" ]]; then
# Increment the patch version
version_parts[2]=$((version_parts[2] + 1))
elif [[ "$type" == "--minor" ]]; then
# Increment the minor version and reset the patch version
version_parts[1]=$((version_parts[1] + 1))
version_parts[2]=0
elif [[ "$type" == "--major" ]]; then
# Increment the major version and reset the minor and patch versions
version_parts[0]=$((version_parts[0] + 1))
version_parts[1]=0
version_parts[2]=0
elif [[ "$type" == "--update-to-version" ]]; then
# Apply the version from the 3rd argument
if [[ -z "$2" ]]; then
echo "Error: No version specified for --update-to-version."
exit 1
fi
new_version="$custom_version"
IFS='.' read -r -a version_parts <<< "$new_version"
else
echo "No --patch flag provided. Exiting."
exit 1
fi
# Join the version parts back together
new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}"
# Replace the old version with the new version in the mix.exs files
for MIX_FILE in "${MIX_FILES[@]}"; do
sed -i '' "s/version: \"$current_version\"/version: \"$new_version\"/" "$MIX_FILE"
done
sed -i '' "s/version: \"$current_version/version: \"$new_version/" "$CONFIG_FILE"
sed -i '' "s/RELEASE_VERSION: $current_version/RELEASE_VERSION: $new_version/" "$DOCKER_COMPOSE_FILE"
sed -i '' "s/RELEASE_VERSION ?= '$current_version'/RELEASE_VERSION ?= '$new_version'/" "$MAKE_FILE"
# Replace the old version with the new version in the GitHub workflows files
for WORKFLOW_FILE in "${WORKFLOW_FILES[@]}"; do
sed -i '' "s/RELEASE_VERSION: $current_version/RELEASE_VERSION: $new_version/" "$WORKFLOW_FILE"
done
echo "Version bumped from $current_version to $new_version"
}
# Call the function
bump_version "$1" "$2"
Loading…
Cancel
Save