Skip to content

Commit 89ce948

Browse files
Alpha workflows: generate and set prerelease_identifier (again)
1 parent 10a7706 commit 89ce948

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,24 @@ on:
1111
env:
1212
DEV_WORKFLOW_REPOSITORY: "rabbitmq/server-packages"
1313
jobs:
14+
compute_prerelease_data:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Compute prerelease identifier from commit SHA
18+
run: echo "PRERELEASE_IDENTIFIER=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV
19+
- name: Compute human-readable release timestamp
20+
run: echo "PRERELEASE_TIMESTAMP=`date --rfc-3339=seconds`" >> $GITHUB_ENV
21+
- name: Compute UNIX release timestamp
22+
run: echo "PRERELEASE_UNIX_TIMESTAMP=`date +%s`" >> $GITHUB_ENV
1423
trigger_alpha_build:
1524
runs-on: ubuntu-latest
1625
steps:
1726
- name: Trigger a 4.0.x alpha release build in ${{ env.DEV_WORKFLOW_REPOSITORY }}
18-
run: |
19-
curl -L \
20-
-X POST \
21-
-H "Accept: application/vnd.github+json" \
22-
-H "Authorization: Bearer ${{ secrets.RABBITMQCI_BOT_TOKEN }}" \
23-
-H "X-GitHub-Api-Version: 2022-11-28" \
24-
https://api.github.com/repos/${{ env.DEV_WORKFLOW_REPOSITORY }}/dispatches \
25-
-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", "release_title": "RabbitMQ ${{ vars.SERVER_41_NEXT_PATCH_VERSION }}-alpha.${{ github.sha }} (from ${{ github.event.repository.pushed_at }})", "base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}" }}'
27+
run: |
28+
curl -L \
29+
-X POST \
30+
-H "Accept: application/vnd.github+json" \
31+
-H "Authorization: Bearer ${{ secrets.RABBITMQCI_BOT_TOKEN }}" \
32+
-H "X-GitHub-Api-Version: 2022-11-28" \
33+
https://api.github.com/repos/${{ env.DEV_WORKFLOW_REPOSITORY }}/dispatches \
34+
-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.${{ github.sha }} (from ${{ github.event.repository.pushed_at }})", "base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}" }}'

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,25 @@ on:
1212
env:
1313
DEV_WORKFLOW_REPOSITORY: "rabbitmq/server-packages"
1414
jobs:
15+
compute_prerelease_data:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Compute prerelease identifier from commit SHA
19+
run: echo "PRERELEASE_IDENTIFIER=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV
20+
- name: Compute human-readable release timestamp
21+
run: echo "PRERELEASE_TIMESTAMP=`date --rfc-3339=seconds`" >> $GITHUB_ENV
22+
- name: Compute UNIX release timestamp
23+
run: echo "PRERELEASE_UNIX_TIMESTAMP=`date +%s`" >> $GITHUB_ENV
1524
trigger_alpha_build:
1625
runs-on: ubuntu-latest
26+
needs: [compute_prerelease_data]
1727
steps:
1828
- name: Trigger a 4.1.x alpha release build in ${{ env.DEV_WORKFLOW_REPOSITORY }}
19-
run: |
20-
curl -L \
21-
-X POST \
22-
-H "Accept: application/vnd.github+json" \
23-
-H "Authorization: Bearer ${{ secrets.RABBITMQCI_BOT_TOKEN }}" \
24-
-H "X-GitHub-Api-Version: 2022-11-28" \
25-
https://api.github.com/repos/${{ env.DEV_WORKFLOW_REPOSITORY }}/dispatches \
26-
-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", "release_title": "RabbitMQ ${{ vars.SERVER_41_NEXT_PATCH_VERSION }}-alpha.${{ github.sha }} (from ${{ github.event.repository.pushed_at }})", "base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}" }}'
29+
run: |
30+
curl -L \
31+
-X POST \
32+
-H "Accept: application/vnd.github+json" \
33+
-H "Authorization: Bearer ${{ secrets.RABBITMQCI_BOT_TOKEN }}" \
34+
-H "X-GitHub-Api-Version: 2022-11-28" \
35+
https://api.github.com/repos/${{ env.DEV_WORKFLOW_REPOSITORY }}/dispatches \
36+
-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.${{ github.sha }} (from ${{ github.event.repository.pushed_at }})", "base_version": "${{ vars.SERVER_41_NEXT_PATCH_VERSION }}" }}'

0 commit comments

Comments
 (0)