diff --git a/.github/workflows/create-github-release.yml b/.github/workflows/create-github-release.yml index 2307f036..8efe116d 100644 --- a/.github/workflows/create-github-release.yml +++ b/.github/workflows/create-github-release.yml @@ -26,6 +26,6 @@ jobs: # Leaving this step here for when we want to publish API docs. # docs: # needs: release -# if: github.ref_name == 'main' -# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main # secrets: inherit +# if: ${{ github.ref_name == 'main' }} +# uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main diff --git a/.github/workflows/failureNotifications.yml b/.github/workflows/failureNotifications.yml new file mode 100644 index 00000000..949f555d --- /dev/null +++ b/.github/workflows/failureNotifications.yml @@ -0,0 +1,43 @@ +name: failureNotifications +on: + workflow_run: + workflows: + - publish + - create-github-release + types: + - completed +jobs: + failure-notify: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - name: Announce Failure + id: slack + uses: slackapi/slack-github-action@v1.26.0 + env: + # for non-CLI-team-owned plugins, you can send this anywhere you like + SLACK_WEBHOOK_URL: ${{ secrets.IDEE_RELEASE_ALERT_SLACK_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + with: + # Payload can be visually tested here: https://app.slack.com/block-kit-builder/T01GST6QY0G#%7B%22blocks%22:%5B%5D%7D + # Only copy over the "blocks" array to the Block Kit Builder + payload: | + { + "text": "Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }}", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": ":bh-alert: Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }} :bh-alert:" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Repo:* ${{ github.event.workflow_run.repository.html_url }}\n*Workflow name:* `${{ github.event.workflow_run.name }}`\n*Job url:* ${{ github.event.workflow_run.html_url }}" + } + } + ] + } diff --git a/.github/workflows/onRelease.yml b/.github/workflows/onRelease.yml index 26dc7dad..369ac538 100644 --- a/.github/workflows/onRelease.yml +++ b/.github/workflows/onRelease.yml @@ -1,17 +1,16 @@ name: publish - on: release: + # both release and prereleases types: [published] # support manual release in case something goes wrong and needs to be repeated or tested workflow_dispatch: inputs: tag: - description: tag that needs to publish + description: github tag that needs to publish type: string required: true jobs: - # parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0) getDistTag: outputs: tag: ${{ steps.distTag.outputs.tag }} diff --git a/.github/workflows/testCommitExceptMain.yml b/.github/workflows/testCommitExceptMain.yml index bab875d7..21e76f0c 100644 --- a/.github/workflows/testCommitExceptMain.yml +++ b/.github/workflows/testCommitExceptMain.yml @@ -4,15 +4,22 @@ on: branches-ignore: [main] jobs: - unit-tests: - uses: salesforcecli/github-workflows/.github/workflows/unitTest.yml@main + yarn-lockfile-check: + uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main + # Since the Windows unit tests take much longer, we run the linux unit tests first and then run the windows unit tests in parallel with NUTs + linux-unit-tests: + needs: yarn-lockfile-check + uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main + windows-unit-tests: + needs: linux-unit-tests + uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main test-bundle: runs-on: ubuntu-latest name: test bundling steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: + with: node-version: lts/* cache: yarn - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main @@ -21,7 +28,7 @@ jobs: - name: check if bundling runs into failures run: node scripts/testEsbuild.js xNuts: - needs: unit-tests + needs: linux-unit-tests name: external NUTs uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main strategy: