Skip to content

Commit

Permalink
Merge pull request #17 from EgorPopelyaev/ep-change-old-rc-tag-to-new
Browse files Browse the repository at this point in the history
change old rc tag to new
  • Loading branch information
EgorPopelyaev authored Oct 11, 2024
2 parents c16ac92 + fd73936 commit a806d36
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
10 changes: 3 additions & 7 deletions .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,10 @@ function find_runtimes() {
# output: none
filter_version_from_input() {
version=$1
regex="(^v[0-9]+\.[0-9]+\.[0-9]+)$|(^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+)$"
regex="^(v)?[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$"

if [[ $version =~ $regex ]]; then
if [ -n "${BASH_REMATCH[1]}" ]; then
echo "${BASH_REMATCH[1]}"
elif [ -n "${BASH_REMATCH[2]}" ]; then
echo "${BASH_REMATCH[2]}"
fi
echo $version
else
echo "Invalid version: $version"
exit 1
Expand Down Expand Up @@ -462,7 +458,7 @@ function get_polkadot_node_version_from_code() {

validate_stable_tag() {
tag="$1"
pattern="^stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"
pattern="^(polkadot-)?stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)?$"

if [[ $tag =~ $pattern ]]; then
echo $tag
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-10_rc-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:
inputs:
version:
description: Current release/rc version in format vX.X.X
description: Current release/rc version in format polkadot-stableYYMM

jobs:
tag_rc:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
if [[ -z "${{ inputs.version }}" ]]; then
version=v$(get_polkadot_node_version_from_code)
else
version=$(filter_version_from_input ${{ inputs.version }})
version=$(validate_stable_tag ${{ inputs.version }})
fi
echo "$version"
echo "version=$version" >> $GITHUB_OUTPUT
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,12 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
release="${{ needs.validate-inputs.outputs.stable_tag }}" && \
echo "release=${release}" >> $GITHUB_OUTPUT
echo "release=${{ needs.validate-inputs.outputs.stable_tag }}" >> $GITHUB_OUTPUT
commit=$(git rev-parse --short HEAD) && \
echo "commit=${commit}" >> $GITHUB_OUTPUT
tag="${{ needs.validate-inputs.outputs.version }}" && \
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "tag=${{ needs.validate-inputs.outputs.version }}" >> $GITHUB_OUTPUT
- name: Fetch release tags
working-directory: release-artifacts
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-branchoff-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ on:
type: string

node_version:
description: Version of the polkadot node in the format vX.XX.X (e.g. 1.15.0)
description: Version of the polkadot node in the format X.XX.X (e.g. 1.15.0)
required: true

jobs:
# TODO: Activate this job when the pipeline is moved to the fork in the `paritytech-release` org
# check-workflow-can-run:
# uses: paritytech-release/sync-workflows/.github/workflows/check-syncronization.yml@latest
# uses: paritytech-release/sync-workflows/.github/workflows/check-syncronization.yml@main


prepare-tooling:
# needs: [check-workflow-can-run]
# if: needs.check-workflow-can-run.outputs.checks_passed == 'true'
runs-on: ubuntu-latest
outputs:
node_version: ${{ steps.validate_inputs.outputs.node_version }}
Expand All @@ -40,9 +42,7 @@ jobs:
echo "stable_version=${stable_version}" >> $GITHUB_OUTPUT
create-stable-branch:
# needs: [check-workflow-can-run, prepare-tooling]
needs: [prepare-tooling]
# if: needs. check-workflow-can-run.outputs.checks_passed == 'true'
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -100,6 +100,6 @@ jobs:
# Set new version for polkadot-parachain binary to match the polkadot node binary
# set_polkadot_parachain_binary_version $NODE_VERSION "cumulus/polkadot-parachain/Cargo.toml"
reorder_prdocs $NODE_VERSION
reorder_prdocs $STABLE_BRANCH_NAME
git push origin "$STABLE_BRANCH_NAME"

0 comments on commit a806d36

Please sign in to comment.