Skip to content

Commit

Permalink
Add stable-rc tags to the docker images (paritytech#5896)
Browse files Browse the repository at this point in the history
This PR adds the `stableYYMM-rcX` or `stableYYMM-X-rcX` tags to the
docker images, so that they could be published with the new tag naming
scheme.

Closes: paritytech/release-engineering#224
  • Loading branch information
EgorPopelyaev committed Oct 10, 2024
1 parent 660da7a commit 02bf8f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function get_polkadot_node_version_from_code() {

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

if [[ $tag =~ $pattern ]]; then
echo $tag
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Validate inputs
id: validate_inputs
Expand All @@ -111,7 +111,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

#TODO: this step will be needed when automated triggering will work
#this step runs only if the workflow is triggered automatically when new release is published
Expand All @@ -134,7 +134,7 @@ jobs:
. ./.github/scripts/common/lib.sh
VERSION="${{ needs.validate-inputs.outputs.VERSION }}"
if [[ $BINARY == 'polkadot' ]]; then
if [[ ${{ inputs.binary }} == 'polkadot' ]]; then
bins=(polkadot polkadot-prepare-worker polkadot-execute-worker)
for bin in "${bins[@]}"; do
fetch_release_artifacts_from_s3 $bin
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
Expand Down Expand Up @@ -194,15 +194,14 @@ jobs:
run: |
. ./.github/scripts/common/lib.sh
release="${{ needs.validate-inputs.outputs.VERSION }}" && \
release="${{ needs.validate-inputs.outputs.stable_tag }}" && \
echo "release=${release}" >> $GITHUB_OUTPUT
commit=$(git rev-parse --short HEAD) && \
echo "commit=${commit}" >> $GITHUB_OUTPUT
tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) && \
[ "${tag}" != "undefined" ] && echo "tag=${tag}" >> $GITHUB_OUTPUT || \
echo "No tag, doing without"
tag="${{ needs.validate-inputs.outputs.version }}" && \
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Fetch release tags
working-directory: release-artifacts
Expand Down Expand Up @@ -322,7 +321,7 @@ jobs:
environment: release
steps:
- name: Checkout sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
Expand Down

0 comments on commit 02bf8f5

Please sign in to comment.