From c11d8d928e16151b0d5e1e88986eb961cd085594 Mon Sep 17 00:00:00 2001 From: Chevdor Date: Fri, 28 Jul 2023 15:05:57 +0200 Subject: [PATCH] Fix matrix rooms (#7143) * Fix matrix rooms * Switch to V2 tokens * Fix bots and tokens (secrets) * Add new notif ref. #7143 * Fix secret name * Add new line * Remove erroneous comment --------- Co-authored-by: parity-processbot <> --- .../workflows/burnin-label-notification.yml | 21 +++++++++++------ .../workflows/release-10_candidate.yml | 23 ++++++++++++++----- .../release-30_publish-draft-release.yml | 20 +++++++++++----- polkadot/.github/workflows/release-99_bot.yml | 20 ++++++++++++---- polkadot/scripts/ci/common/lib.sh | 2 +- 5 files changed, 62 insertions(+), 24 deletions(-) diff --git a/polkadot/.github/workflows/burnin-label-notification.yml b/polkadot/.github/workflows/burnin-label-notification.yml index 5b9fbcab96..536f8fa2a3 100644 --- a/polkadot/.github/workflows/burnin-label-notification.yml +++ b/polkadot/.github/workflows/burnin-label-notification.yml @@ -6,12 +6,19 @@ on: jobs: notify-devops: runs-on: ubuntu-latest + strategy: + matrix: + channel: + - name: 'Team: DevOps' + room: '!lUslSijLMgNcEKcAiE:parity.io' + steps: - - name: Notify devops - if: github.event.label.name == 'A1-needsburnin' - uses: s3krit/matrix-message-action@v0.0.3 + - name: Send Matrix message to ${{ matrix.channel.name }} + if: startsWith(github.event.label.name, 'A1-') + uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 with: - room_id: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ROOM_ID }} - access_token: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ACCESS_TOKEN }} - message: "@room Burn-in request received for the following PR: ${{ github.event.pull_request.html_url }}" - server: "matrix.parity.io" + room_id: ${{ matrix.channel.room }} + access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} + server: m.parity.io + message: | + @room Burn-in request received for the following PR: ${{ github.event.pull_request.html_url }} diff --git a/polkadot/.github/workflows/release-10_candidate.yml b/polkadot/.github/workflows/release-10_candidate.yml index be12406317..54a937a781 100644 --- a/polkadot/.github/workflows/release-10_candidate.yml +++ b/polkadot/.github/workflows/release-10_candidate.yml @@ -7,6 +7,12 @@ on: jobs: tag_rc: runs-on: ubuntu-latest + strategy: + matrix: + channel: + - name: "RelEng: Polkadot Release Coordination" + room: '!cqAmzdIcbOFwrdrubV:parity.io' + steps: - name: Checkout sources uses: actions/checkout@v3 @@ -33,6 +39,7 @@ jobs: echo "new_tag=$version-rc1" >> $GITHUB_OUTPUT echo "first_rc=true" >> $GITHUB_OUTPUT fi + - name: Apply new tag uses: tvdias/github-tagger@ed7350546e3e503b5e942dffd65bc8751a95e49d # v0.0.2 with: @@ -41,6 +48,7 @@ jobs: # RELEASE_BRANCH_TOKEN requires public_repo OAuth scope repo-token: "${{ secrets.RELEASE_BRANCH_TOKEN }}" tag: ${{ steps.compute_tag.outputs.new_tag }} + - id: create-issue uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1 # Only create the issue if it's the first release candidate @@ -50,11 +58,14 @@ jobs: VERSION: ${{ steps.compute_tag.outputs.version }} with: filename: .github/ISSUE_TEMPLATE/release.md - - name: Send Matrix message - uses: s3krit/matrix-message-action@v0.0.3 + + - name: Send Matrix message to ${{ matrix.channel.name }} + uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 if: steps.create-issue.outputs.url != '' with: - room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }} - access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} - server: "matrix.parity.io" - message: "Release process for polkadot ${{ steps.compute_tag.outputs.version }} has been started. Tracking issue: ${{ steps.create-issue.outputs.url }}" + room_id: ${{ matrix.channel.room }} + access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} + server: m.parity.io + message: | + Release process for polkadot ${{ steps.compute_tag.outputs.version }} has been started.
+ Tracking issue: ${{ steps.create-issue.outputs.url }} diff --git a/polkadot/.github/workflows/release-30_publish-draft-release.yml b/polkadot/.github/workflows/release-30_publish-draft-release.yml index 4759436663..ce6f31fa54 100644 --- a/polkadot/.github/workflows/release-30_publish-draft-release.yml +++ b/polkadot/.github/workflows/release-30_publish-draft-release.yml @@ -181,11 +181,19 @@ jobs: post_to_matrix: runs-on: ubuntu-latest needs: publish-draft-release + strategy: + matrix: + channel: + - name: "RelEng: Polkadot Release Coordination" + room: '!cqAmzdIcbOFwrdrubV:parity.io' + steps: - - name: Internal polkadot channel - uses: s3krit/matrix-message-action@v0.0.3 + - name: Send Matrix message to ${{ matrix.channel.name }} + uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 with: - room_id: ${{ secrets.INTERNAL_POLKADOT_MATRIX_ROOM_ID }} - access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} - message: "**New version of polkadot tagged**: ${{ github.ref }}
Draft release created: ${{ needs.publish-draft-release.outputs.release_url }}" - server: "matrix.parity.io" + room_id: ${{ matrix.channel.room }} + access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} + server: m.parity.io + message: | + **New version of polkadot tagged**: ${{ github.ref }}
+ Draft release created: ${{ needs.publish-draft-release.outputs.release_url }} diff --git a/polkadot/.github/workflows/release-99_bot.yml b/polkadot/.github/workflows/release-99_bot.yml index 370ab96531..5d45c0d44e 100644 --- a/polkadot/.github/workflows/release-99_bot.yml +++ b/polkadot/.github/workflows/release-99_bot.yml @@ -21,17 +21,29 @@ jobs: - name: '#polkadot-announcements:matrix.parity.io' room: '!UqHPWiCBGZWxrmYBkF:matrix.parity.io' pre-release: false + - name: "RelEng: Polkadot Release Coordination" + room: '!cqAmzdIcbOFwrdrubV:parity.io' + pre-release: true - name: 'Ledger <> Polkadot Coordination' room: '!EoIhaKfGPmFOBrNSHT:web3.foundation' pre-release: true + - name: 'General: Rust, Polkadot, Substrate' + room: '!aJymqQYtCjjqImFLSb:parity.io' + pre-release: false + - name: 'Team: DevOps' + room: '!lUslSijLMgNcEKcAiE:parity.io' + pre-release: true runs-on: ubuntu-latest steps: - name: Send Matrix message to ${{ matrix.channel.name }} if: github.event.release.prerelease == false || matrix.channel.pre-release - uses: s3krit/matrix-message-action@v0.0.3 + uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 with: room_id: ${{ matrix.channel.room }} - access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} - server: "m.parity.io" - message: "***Polkadot ${{github.event.release.tag_name}} has been released!***
${{github.event.release.html_url}}

${{github.event.release.body}}
" + access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} + server: m.parity.io + message: | + ***Polkadot ${{github.event.release.tag_name}} has been released!***
+ ${{github.event.release.html_url}}

+ ${{github.event.release.body}}
diff --git a/polkadot/scripts/ci/common/lib.sh b/polkadot/scripts/ci/common/lib.sh index ba5b171487..2e94feb150 100755 --- a/polkadot/scripts/ci/common/lib.sh +++ b/polkadot/scripts/ci/common/lib.sh @@ -96,7 +96,7 @@ structure_message() { # access_token: see https://matrix.org/docs/guides/client-server-api/ # Usage: send_message $body (json formatted) $room_id $access_token send_message() { -curl -XPOST -d "$1" "https://matrix.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3" + curl -XPOST -d "$1" "https://m.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3" } # Pretty-printing functions