Skip to content

Commit 25f0a61

Browse files
alpha release workflows: don't reinvent the wheel
1 parent b1c82b4 commit 25f0a61

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

.github/workflows/release-4.0.x-alphas.yaml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ jobs:
1717
steps:
1818
- name: Compute prerelease identifier from commit SHA
1919
run: echo "PRERELEASE_IDENTIFIER=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV
20-
- name: Trigger a 4.0.x alpha release build in ${{ env.DEV_WORKFLOW_REPOSITORY }}
21-
run: |
22-
curl -L \
23-
-X POST \
24-
-H "Accept: application/vnd.github+json" \
25-
-H "Authorization: Bearer ${{ secrets.RABBITMQCI_BOT_TOKEN }}" \
26-
-H "X-GitHub-Api-Version: 2022-11-28" \
27-
https://api.github.com/repos/${{ env.DEV_WORKFLOW_REPOSITORY }}/dispatches \
28-
-d '{ "event_type": "new_4.0.x_alpha", "client_payload": {"release_repository": "${{ env.DEV_WORKFLOW_REPOSITORY }}", "release_description": "Commit: https://github.com/rabbitmq/rabbitmq-server/commit/${{ github.sha }}, pushed at: ${{ github.event.repository.pushed_at }}", "prerelease": true, "prerelease_kind": "alpha", "prerelease_identifier": "${{ env.PRERELEASE_IDENTIFIER }}", "release_title": "RabbitMQ ${{ vars.SERVER_40_NEXT_PATCH_VERSION }}-alpha.${{ env.PRERELEASE_IDENTIFIER }} (from ${{ github.event.repository.pushed_at }})", "base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}" }}'
20+
- name: Trigger a 4.0.x alpha build in ${{ env.DEV_WORKFLOW_REPOSITORY }}
21+
uses: peter-evans/repository-dispatch@v3
22+
with:
23+
token: ${{ secrets.RABBITMQCI_BOT_TOKEN }}
24+
repository: ${{ env.DEV_WORKFLOW_REPOSITORY }}
25+
event-type: "new_4.0.x_alpha"
26+
client-payload: |-
27+
{
28+
"release_repository": "${{ env.DEV_WORKFLOW_REPOSITORY }}",
29+
"release_description": "Commit: https://github.com/rabbitmq/rabbitmq-server/commit/${{ github.sha }}, pushed at: ${{ github.event.repository.pushed_at }}",
30+
"prerelease": true,
31+
"prerelease_kind": "alpha",
32+
"prerelease_identifier": "${{ env.PRERELEASE_IDENTIFIER }}",
33+
"release_title": "RabbitMQ ${{ vars.SERVER_40_NEXT_PATCH_VERSION }}-alpha.${{ env.PRERELEASE_IDENTIFIER }} (from ${{ github.event.repository.pushed_at }})",
34+
"base_version": "${{ vars.SERVER_40_NEXT_PATCH_VERSION }}"
35+
}

.github/workflows/release-4.1.x-alphas.yaml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ jobs:
1818
steps:
1919
- name: Compute prerelease identifier from commit SHA
2020
run: echo "PRERELEASE_IDENTIFIER=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV
21-
- name: Trigger a 4.1.x alpha release build in ${{ env.DEV_WORKFLOW_REPOSITORY }}
22-
run: |
23-
curl -L \
24-
-X POST \
25-
-H "Accept: application/vnd.github+json" \
26-
-H "Authorization: Bearer ${{ secrets.RABBITMQCI_BOT_TOKEN }}" \
27-
-H "X-GitHub-Api-Version: 2022-11-28" \
28-
https://api.github.com/repos/${{ env.DEV_WORKFLOW_REPOSITORY }}/dispatches \
29-
-d '{ "event_type": "new_4.1.x_alpha", "client_payload": {"release_repository": "${{ env.DEV_WORKFLOW_REPOSITORY }}", "release_description": "Commit: https://github.com/rabbitmq/rabbitmq-server/commit/${{ github.sha }}, pushed at: ${{ github.event.repository.pushed_at }}", "prerelease": true, "prerelease_kind": "alpha", "prerelease_identifier": "${{ env.PRERELEASE_IDENTIFIER }}", "release_title": "RabbitMQ ${{ vars.SERVER_41_NEXT_PATCH_VERSION }}-alpha.${{ env.PRERELEASE_IDENTIFIER }} (from ${{ github.event.repository.pushed_at }})", "base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}" }}'
21+
- name: Trigger a 4.0.x alpha build in ${{ env.DEV_WORKFLOW_REPOSITORY }}
22+
uses: peter-evans/repository-dispatch@v3
23+
with:
24+
token: ${{ secrets.RABBITMQCI_BOT_TOKEN }}
25+
repository: ${{ env.DEV_WORKFLOW_REPOSITORY }}
26+
event-type: "new_4.1.x_alpha"
27+
client-payload: |-
28+
{
29+
"release_repository": "${{ env.DEV_WORKFLOW_REPOSITORY }}",
30+
"release_description": "Commit: https://github.com/rabbitmq/rabbitmq-server/commit/${{ github.sha }}, pushed at: ${{ github.event.repository.pushed_at }}",
31+
"prerelease": true,
32+
"prerelease_kind": "alpha",
33+
"prerelease_identifier": "${{ env.PRERELEASE_IDENTIFIER }}",
34+
"release_title": "RabbitMQ ${{ vars.SERVER_40_NEXT_PATCH_VERSION }}-alpha.${{ env.PRERELEASE_IDENTIFIER }} (from ${{ github.event.repository.pushed_at }})",
35+
"base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}"
36+
}

0 commit comments

Comments
 (0)