diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index 2c34fd65371..4300cd18ac3 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -39,7 +39,9 @@ jobs: submodules: true - 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 c346deb3d7d..18699f31283 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -332,6 +332,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 ad166637b1b..8d5b2f3747e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -302,6 +302,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 00000000000..8b39c586b13 --- /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