From 055299f2967c601fe497f41e45b3190f0811fe27 Mon Sep 17 00:00:00 2001 From: Pulumi Bot Date: Sat, 30 Sep 2023 05:09:01 +0000 Subject: [PATCH] [internal] Update GitHub Actions workflow files --- .github/workflows/command-dispatch.yml | 4 ++- .github/workflows/master.yml | 18 +++++++++++ .github/workflows/release.yml | 20 ++++++++++++ .github/workflows/release_command.yml | 43 ++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release_command.yml diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index 4d0418fc..8d65b5e9 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -38,7 +38,9 @@ jobs: uses: actions/checkout@v3 - uses: peter-evans/slash-command-dispatch@v2 with: - commands: run-acceptance-tests + commands: | + run-acceptance-tests + release issue-type: pull-request permission: write reaction-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index ab0d731a..383a5088 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -319,6 +319,24 @@ jobs: if: failure() name: Send Publish Failure To Slack uses: rtCamp/action-slack-notify@v2 + + tag_release_if_labeled_needs_release: + name: Tag release if labeled as needs-release + needs: publish_sdk + runs-on: ubuntu-latest + steps: + - name: check if this commit needs release + uses: pulumi/action-release-by-pr-label@main + with: + command: "release-if-needed" + repo: ${{ github.repository }} + commit: ${{ github.sha }} + slack_channel: ${{ secrets.RELEASE_OPS_SLACK_CHANNEL }} + env: + RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }} + RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + test: name: test needs: build_sdk diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7dd8a8a3..845ff19b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -291,6 +291,26 @@ jobs: - name: Add SDK version tag run: git tag "sdk/v$(pulumictl get version --language generic)" && git push origin "sdk/v$(pulumictl get version --language generic)" + + clean_up_release_labels: + name: Clean up release labels + needs: create_docs_build + + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Unshallow clone for PR merge bases + run: git fetch --prune --unshallow --tags + - name: Clean up release labels + uses: pulumi/action-release-by-pr-label@main + with: + command: "clean-up-release-labels" + repo: ${{ github.repository }} + commit: ${{ github.sha }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + test: name: test needs: build_sdk diff --git a/.github/workflows/release_command.yml b/.github/workflows/release_command.yml new file mode 100644 index 00000000..8b39c586 --- /dev/null +++ b/.github/workflows/release_command.yml @@ -0,0 +1,43 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +name: release-command +on: + repository_dispatch: + types: + - release-command +jobs: + should_release: + name: Should release PR + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Should release PR + uses: pulumi/action-release-by-pr-label@main + with: + command: "should-release" + repo: ${{ github.repository }} + pr: ${{ github.event.client_payload.pull_request.number }} + version: ${{ github.event.client_payload.slash_command.args.all }} + slack_channel: ${{ secrets.RELEASE_OPS_STAGING_SLACK_CHANNEL }} + env: + RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }} + RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() + name: Notify failure + uses: peter-evans/create-or-update-comment@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + issue-number: ${{ github.event.client_payload.github.payload.issue.number }} + body: | + "release command failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + - if: success() + name: Notify success + uses: peter-evans/create-or-update-comment@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + reaction-type: hooray