Skip to content

Commit e1f3525

Browse files
[stable2503] Backport #10419 (#10429)
Backport #10419 into `stable2503` from EgorPopelyaev. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Egor_P <[email protected]>
1 parent 5aa512b commit e1f3525

File tree

1 file changed

+54
-3
lines changed

1 file changed

+54
-3
lines changed

.github/workflows/release-99_notif-published.yml

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,47 @@ on:
33
release:
44
types:
55
- published
6-
- prereleased
76

87
jobs:
8+
check_if_release_is_latest:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
is_latest: ${{ steps.check_is_latest.outputs.is_latest }}
12+
steps:
13+
- name: Fetch latest release tag name
14+
id: fetch_latest_release_tag
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
run: |
18+
TAG_NAME=$(curl -H "Accept: application/vnd.github+json" \
19+
-H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: Bearer ${GITHUB_TOKEN}" \
20+
-sL "https://api.github.com/repos/${{ github.repository }}/releases/latest" \
21+
| jq -r '.tag_name')
22+
23+
echo "Latest release tag: $TAG_NAME"
24+
echo "latest_tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
25+
- name: Fetch current release tag name
26+
id: fetch_curent_release_tag
27+
run: |
28+
CURRENT_RELEASE_TAG_NAME=${{github.event.release.tag_name}}
29+
echo "Current release tag: $CURRENT_RELEASE_TAG_NAME"
30+
echo "current_tag_name=$CURRENT_RELEASE_TAG_NAME" >> $GITHUB_OUTPUT
31+
32+
- name: Check if release is latest
33+
id: check_is_latest
34+
run: |
35+
if [[ "${{ steps.fetch_latest_release_tag.outputs.latest_tag_name }}" == "${{ steps.fetch_curent_release_tag.outputs.current_tag_name }}" ]]; then
36+
echo "Release is latest"
37+
echo "is_latest=true" >> $GITHUB_OUTPUT
38+
else
39+
echo "Release is not latest"
40+
echo "is_latest=false" >> $GITHUB_OUTPUT
41+
fi
42+
943
ping_matrix:
1044
runs-on: ubuntu-latest
45+
needs: [check_if_release_is_latest]
46+
if: ${{ needs.check_if_release_is_latest.outputs.is_latest == 'true' }}
1147
environment: release
1248
strategy:
1349
matrix:
@@ -20,7 +56,7 @@ jobs:
2056
# External
2157
- name: 'Ledger <> Polkadot Coordination'
2258
room: '!EoIhaKfGPmFOBrNSHT:web3.foundation'
23-
pre-release: true
59+
pre-release: false
2460

2561
# Public
2662
- name: '#polkadotvalidatorlounge:web3.foundation'
@@ -34,6 +70,20 @@ jobs:
3470
pre-releases: false
3571

3672
steps:
73+
- name: Checkout
74+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
75+
with:
76+
ref: ${{ github.event.release.tag_name }}
77+
78+
- name: Extract node version
79+
id: extract_version
80+
run: |
81+
. ./.github/scripts/common/lib.sh
82+
83+
version=v$(get_polkadot_node_version_from_code)
84+
echo "Extracted node version: $version"
85+
echo "node_version=$version" >> $GITHUB_OUTPUT
86+
3787
- name: Matrix notification to ${{ matrix.channel.name }}
3888
if: github.event.release.prerelease == false || matrix.channel.pre-release
3989
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
@@ -45,6 +95,7 @@ jobs:
4595
@room
4696
4797
A new node release has been ${{github.event.action}} in **${{github.event.repository.full_name}}:**<br/>
48-
Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}})
98+
Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}})<br/>
99+
Node version: ${{ steps.extract_version.outputs.node_version }}
49100
50101
-----

0 commit comments

Comments
 (0)