|
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' |
@@ -48,18 +84,18 @@ jobs: |
48 | 84 | echo "Extracted node version: $version" |
49 | 85 | echo "node_version=$version" >> $GITHUB_OUTPUT |
50 | 86 |
|
51 | | - - name: Matrix notification to ${{ matrix.channel.name }} |
52 | | - if: github.event.release.prerelease == false || matrix.channel.pre-release |
53 | | - uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 |
54 | | - with: |
55 | | - room_id: ${{ matrix.channel.room }} |
56 | | - access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} |
57 | | - server: m.parity.io |
58 | | - message: | |
59 | | - @room |
| 87 | + # - name: Matrix notification to ${{ matrix.channel.name }} |
| 88 | + # if: github.event.release.prerelease == false || matrix.channel.pre-release |
| 89 | + # uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 |
| 90 | + # with: |
| 91 | + # room_id: ${{ matrix.channel.room }} |
| 92 | + # access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} |
| 93 | + # server: m.parity.io |
| 94 | + # message: | |
| 95 | + # @room |
60 | 96 |
|
61 | | - A new node release has been ${{github.event.action}} in **${{github.event.repository.full_name}}:**<br/> |
62 | | - Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}})<br/> |
63 | | - Node version: ${{ steps.extract_version.outputs.node_version }} |
| 97 | + # A new node release has been ${{github.event.action}} in **${{github.event.repository.full_name}}:**<br/> |
| 98 | + # Release version: [${{github.event.release.tag_name}}](${{github.event.release.html_url}})<br/> |
| 99 | + # Node version: ${{ steps.extract_version.outputs.node_version }} |
64 | 100 |
|
65 | | - ----- |
| 101 | + # ----- |
0 commit comments