v3.0.0 #53
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish packages on NPM | |
| on: | |
| release: | |
| types: [released] | |
| workflow_dispatch: {} # Allow for manual trigger. | |
| jobs: | |
| publish: | |
| name: Publish to NPM | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: 'package.json' | |
| - run: yarn config set npmAuthToken $YARN_NPM_AUTH_TOKEN | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.PUBLISH_NPM_TOKEN }} | |
| - run: yarn | |
| - run: yarn workspace @datadog/rollup-plugin buildBasic | |
| - run: export BUILD_PLUGINS_ENV=production | |
| - run: yarn publish:all | |
| env: | |
| ADD_BUILD_PLUGINS: 1 | |
| DD_GITHUB_JOB_NAME: Publish to NPM # Needs to be the same as the job to have CI Vis link the spans. | |
| DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} | |
| - name: Log version published | |
| run: | | |
| VERSION="$(yarn workspace @datadog/webpack-plugin info @datadog/webpack-plugin --json | jq -r '.children.Version')" | |
| HEADERS=( | |
| -H "Content-Type: application/json" | |
| -H "X-Datadog-Origin: build-plugins" | |
| -H "DD-API-KEY: $DATADOG_API_KEY" | |
| ) | |
| DATA="{ | |
| \"ddsource\": \"github\", | |
| \"service\": \"build-plugins\", | |
| \"message\": \"Latest version published: $VERSION\", | |
| \"status\": \"success\", | |
| \"env\": \"production\", | |
| \"team\": \"language-foundations\", | |
| \"version\": \"$VERSION\" | |
| }" | |
| URL="https://http-intake.logs.datadoghq.com/api/v2/logs" | |
| curl -X POST "${HEADERS[@]}" -d "$DATA" "$URL" | |
| env: | |
| DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} |