|
3 | 3 | release: |
4 | 4 | types: |
5 | 5 | - published |
6 | | - - prereleased |
7 | 6 |
|
8 | 7 | 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 | +
|
9 | 43 | ping_matrix: |
10 | 44 | runs-on: ubuntu-latest |
| 45 | + needs: [check_if_release_is_latest] |
| 46 | + if: ${{ needs.check_if_release_is_latest.outputs.is_latest == 'true' }} |
11 | 47 | environment: release |
12 | 48 | strategy: |
13 | 49 | matrix: |
|
20 | 56 | # External |
21 | 57 | - name: 'Ledger <> Polkadot Coordination' |
22 | 58 | room: '!EoIhaKfGPmFOBrNSHT:web3.foundation' |
23 | | - pre-release: true |
| 59 | + pre-release: false |
24 | 60 |
|
25 | 61 | # Public |
26 | 62 | - name: '#polkadotvalidatorlounge:web3.foundation' |
|
34 | 70 | pre-releases: false |
35 | 71 |
|
36 | 72 | 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 | +
|
37 | 87 | - name: Matrix notification to ${{ matrix.channel.name }} |
38 | 88 | if: github.event.release.prerelease == false || matrix.channel.pre-release |
39 | 89 | uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 |
|
45 | 95 | @room |
46 | 96 |
|
47 | 97 | 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 }} |
49 | 100 |
|
50 | 101 | ----- |
0 commit comments