From 35bec3545c68248c1bf0f2718634eca9b6d2319c Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 30 Aug 2023 15:59:58 +0200 Subject: [PATCH] Run createOrUpdateStagingDeploy after platformDeploy completes --- .github/workflows/finishReleaseCycle.yml | 28 ----------------------- .github/workflows/platformDeploy.yml | 29 ++++++++++++++++++++++++ .github/workflows/preDeploy.yml | 19 ---------------- 3 files changed, 29 insertions(+), 47 deletions(-) diff --git a/.github/workflows/finishReleaseCycle.yml b/.github/workflows/finishReleaseCycle.yml index b78a5fac4b69..7b71f6263c88 100644 --- a/.github/workflows/finishReleaseCycle.yml +++ b/.github/workflows/finishReleaseCycle.yml @@ -119,31 +119,3 @@ jobs: uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main with: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - - # Create a new StagingDeployCash for the next release cycle. - createNewStagingDeployCash: - runs-on: ubuntu-latest - needs: [updateStaging, createNewPatchVersion] - steps: - - uses: actions/checkout@v3 - with: - ref: staging - token: ${{ secrets.OS_BOTIFY_TOKEN }} - - # Create a local git tag so that GitUtils.getPullRequestsMergedBetween can use `git log` to generate a - # list of pull requests that were merged between this version tag and another. - # NOTE: This tag is only used locally and shouldn't be pushed to the remote. - # If it was pushed, that would trigger the staging deploy which is handled in a separate workflow (deploy.yml) - - name: Tag version - run: git tag ${{ needs.createNewPatchVersion.outputs.NEW_VERSION }} - - - name: Create new StagingDeployCash - uses: Expensify/App/.github/actions/javascript/createOrUpdateStagingDeploy@main - with: - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} - NPM_VERSION: ${{ needs.createNewPatchVersion.outputs.NEW_VERSION }} - - - if: ${{ failure() }} - uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main - with: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 84f8373ff247..b50a14dc9ca1 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -387,3 +387,32 @@ jobs: DESKTOP: ${{ needs.desktop.result }} IOS: ${{ needs.iOS.result }} WEB: ${{ needs.web.result }} + + deployChecklist: + name: Create or update deploy checklist + runs-on: ubuntu-latest + if: ${{ always() }} + needs: [android, desktop, iOS, web] + steps: + - name: Quit early if all platforms failed + run: | + if [[ ${{ needs.android.result }} != 'success' && \ + ${{ needs.desktop.result }} != 'success' && \ + ${{ needs.iOS.result }} != 'success' && \ + ${{ needs.web.result }} != 'success' ]]; then + echo 'Deploy failed on all platforms, not updating the checklist...' + exit 1 + fi + + - uses: actions/checkout@v3 + + - uses: Expensify/App/.github/actions/composite/setupNode@main + + - name: Set version + run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV" + + - name: Create or update staging deploy + uses: Expensify/App/.github/actions/javascript/createOrUpdateStagingDeploy@main + with: + GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + NPM_VERSION: ${{ needs.createNewVersion.outputs.NEW_VERSION }} diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index c9fb636238aa..e3977734fc50 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -98,25 +98,6 @@ jobs: # Force-update the remote staging branch git push --force origin staging - # Create a local git tag on staging so that GitUtils.getPullRequestsMergedBetween can use `git log` to generate a - # list of pull requests that were merged between this version tag and another. - # NOTE: This tag is only used locally and shouldn't be pushed to the remote. - # If it was pushed, that would trigger the staging deploy which is handled in a separate workflow (deploy.yml) - - name: Tag staging - run: git tag ${{ needs.createNewVersion.outputs.NEW_VERSION }} - - - name: Update StagingDeployCash - uses: Expensify/App/.github/actions/javascript/createOrUpdateStagingDeploy@main - with: - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} - NPM_VERSION: ${{ needs.createNewVersion.outputs.NEW_VERSION }} - - - name: Find open StagingDeployCash - id: getStagingDeployCash - run: echo "STAGING_DEPLOY_CASH=$(gh issue list --label StagingDeployCash --json number --jq '.[0].number')" >> "$GITHUB_OUTPUT" - env: - GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} - - if: ${{ failure() }} uses: Expensify/App/.github/actions/composite/announceFailedWorkflowInSlack@main with: