From 62614bf854d25f8acd6615c8e79060589ac4cba4 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Fri, 9 Aug 2024 15:40:07 +0300 Subject: [PATCH] ci: skip announce when package is already published (#8438) --- .github/workflows/publish.yml | 34 +++++++++++++++++----------------- scripts/publish.ts | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 67a9baed10d4..c608908a3b09 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,7 @@ jobs: publish: name: Publish runs-on: ubuntu-latest + allow-failure: true env: NX_SKIP_NX_CACHE: true steps: @@ -29,24 +30,23 @@ jobs: id: info run: echo "version=v$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT -# TODO: uncomment later -# - name: Announce to Time messenger -# uses: taiga-family/ci/actions/messenger/time/announce@v1.66.4 -# if: ${{ !contains(steps.info.outputs.version, 'rc') }} -# with: -# url: ${{ secrets.ANNOUNCE_WEBHOOK }} -# channel: ${{ secrets.ANNOUNCE_TARGET }} -# version: ${{ steps.info.outputs.version }} + - name: Announce to Time messenger + uses: taiga-family/ci/actions/messenger/time/announce@v1.66.4 + if: ${{ !contains(steps.info.outputs.version, 'rc') }} + with: + url: ${{ secrets.ANNOUNCE_WEBHOOK }} + channel: ${{ secrets.ANNOUNCE_TARGET }} + version: ${{ steps.info.outputs.version }} -# - name: Announce to Telegram messenger -# uses: taiga-family/ci/actions/messenger/telegram/announce@v1.66.4 -# if: ${{ !contains(steps.info.outputs.version, 'rc') }} -# with: -# chatId: ${{ secrets.TAIGA_TELEGRAM_CHAT_ID }} -# topicId: ${{ secrets.TAIGA_TELEGRAM_CHAT_THREAD_ID }} -# token: ${{ secrets.TAIGA_TELEGRAM_BOT_TOKEN }} -# version: ${{ steps.info.outputs.version }} -# textLink: '@taiga-ui/cdk' + - name: Announce to Telegram messenger + uses: taiga-family/ci/actions/messenger/telegram/announce@v1.66.4 + if: ${{ !contains(steps.info.outputs.version, 'rc') }} + with: + chatId: ${{ secrets.TAIGA_TELEGRAM_CHAT_ID }} + topicId: ${{ secrets.TAIGA_TELEGRAM_CHAT_THREAD_ID }} + token: ${{ secrets.TAIGA_TELEGRAM_BOT_TOKEN }} + version: ${{ steps.info.outputs.version }} + textLink: '@taiga-ui/cdk' concurrency: group: release-${{ github.workflow }}-${{ github.ref }} diff --git a/scripts/publish.ts b/scripts/publish.ts index 4c622a55b750..b3d7dfff1018 100644 --- a/scripts/publish.ts +++ b/scripts/publish.ts @@ -23,7 +23,7 @@ const path = getValueByFlag('--path', ''); if (versions.includes(version) && !isDryRun) { errorLog(`${packageJson.name}@${version} is already published`); - return; + process.exit(1); } infoLog(`name: ${packageJson.name}`);