diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index d44eca4c..424fa081 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -36,7 +36,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 6f2d2062..d922a980 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -317,6 +317,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 88d9b123..d3cf8063 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -289,6 +289,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