Skip to content

Bump the versions

Bump the versions #27

Workflow file for this run

name: Bump the versions
on:
workflow_dispatch:
inputs:
version:
description: 'What to bump?'
required: true
default: 'patch'
type: choice
options:
- 'patch'
- 'minor'
- 'major'
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for "yarn version" to work.
token: ${{ secrets.DD_INFRA_BOT_GH_ACTIONS_TOKEN }} # Needed for the push at the end of the action.
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: yarn install
- run: yarn version:all ${{ inputs.version }}
- run: git add .
- run: |
TAG_NAME="v$(yarn workspace @datadog/webpack-plugin info @datadog/webpack-plugin --json | jq -r '.children.Version')"
GIT_AUTHOR_NAME='dd-infra-bot',
GIT_COMMITTER_NAME='dd-infra-bot',
GIT_AUTHOR_EMAIL='robot-github-mergequeue@datadoghq.com',
GIT_COMMITTER_EMAIL='robot-github-mergequeue@datadoghq.com',
git config --global user.email $GIT_AUTHOR_EMAIL
git config --global user.name $GIT_AUTHOR_NAME
git commit -m $TAG_NAME
git tag -a $TAG_NAME -m $TAG_NAME
git push --follow-tags
- name: Log bump
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\": \"Version bumped: $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 }}