diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1549510c6..f80bb8da71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,11 +138,9 @@ jobs: - name: Upload installer size if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && github.ref == 'refs/heads/main' }} run: | - node ts/scripts/dd-installer-size.node.js macos-arm64 - node ts/scripts/dd-installer-size.node.js macos-x64 - node ts/scripts/dd-installer-size.node.js macos-universal - env: - DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + node ts/scripts/publish-installer-size.node.js macos-arm64 + node ts/scripts/publish-installer-size.node.js macos-x64 + node ts/scripts/publish-installer-size.node.js macos-universal - run: pnpm run test-release env: NODE_ENV: production @@ -224,9 +222,7 @@ jobs: - name: Upload installer size if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && github.ref == 'refs/heads/main' }} - run: node ts/scripts/dd-installer-size.node.js linux - env: - DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + run: node ts/scripts/publish-installer-size.node.js linux - run: xvfb-run --auto-servernum pnpm run test-node @@ -306,9 +302,7 @@ jobs: - name: Upload installer size if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && github.ref == 'refs/heads/main' }} - run: node ts/scripts/dd-installer-size.node.js windows - env: - DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + run: node ts/scripts/publish-installer-size.node.js windows - run: pnpm run test-electron env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 89ed0441dc..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2021 Signal Messenger, LLC -# SPDX-License-Identifier: AGPL-3.0-only - -name: On Release -on: - push: - tags: - - 'v[0-9]+.[0-9]+.*' - -jobs: - create-release-event: - name: Create release event in datadog - if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }} - runs-on: ubuntu-latest - steps: - - name: Create event on DataDog - run: | - curl -X POST "https://api.datadoghq.com/api/v1/events" \ - -H "Accept: application/json" \ - -H "Content-Type: application/json" \ - -H "DD-API-KEY: ${DD_API_KEY}" \ - -d ' - { - "title": "Desktop Release ${{ github.ref_name }}", - "text": "A new desktop release ${{ github.ref_name }} was just published", - "source_type_name": "git", - "tags": [ - "service:desktop.ci.release", - "env:production", - "version:${{ github.ref_name }}" - ] - } - ' - env: - DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} diff --git a/ts/scripts/dd-installer-size.node.ts b/ts/scripts/publish-installer-size.node.ts similarity index 62% rename from ts/scripts/dd-installer-size.node.ts rename to ts/scripts/publish-installer-size.node.ts index 0d9a00b5a7..0f13d3220a 100644 --- a/ts/scripts/dd-installer-size.node.ts +++ b/ts/scripts/publish-installer-size.node.ts @@ -16,17 +16,13 @@ const SUPPORT_CONFIG = new Set([ const RELEASE_DIR = join(__dirname, '..', '..', 'release'); +// TODO: DESKTOP-9836 async function main(): Promise { const config = process.argv[2]; if (!SUPPORT_CONFIG.has(config)) { throw new Error(`Invalid argument: ${config}`); } - const { DD_API_KEY } = process.env; - if (DD_API_KEY == null) { - throw new Error('Missing DD_API_KEY env variable'); - } - let fileName: string; let platform: string; let arch: string; @@ -57,41 +53,7 @@ async function main(): Promise { const filePath = join(RELEASE_DIR, fileName); const { size } = await stat(filePath); - const res = await fetch('https://api.datadoghq.com/api/v2/series', { - method: 'POST', - headers: { - 'content-type': 'application/json', - 'DD-API-KEY': DD_API_KEY, - }, - body: JSON.stringify({ - series: [ - { - metric: 'desktop.ci.installerSize', - type: 0, - points: [ - { - timestamp: Math.floor(Date.now() / 1000), - value: size, - }, - ], - tags: [ - `hash:${process.env.GITHUB_SHA ?? ''}`, - `platform:${platform}`, - `arch:${arch}`, - ], - }, - ], - }), - }); - - if (!res.ok) { - throw new Error( - `Failed to submit metrics, status: ${res.status}, ` + - `body: ${await res.text()}` - ); - } - - console.log(`Submitted: ${size}`); + console.log(`${platform} ${arch} release size: ${size}`); } main().catch(err => {