From e09fb11363a76af0ba6d6ead780fb9f030657a41 Mon Sep 17 00:00:00 2001 From: Yoann Moinet Date: Wed, 19 Feb 2025 18:46:47 +0100 Subject: [PATCH] Add bump workflow --- .github/workflows/bump.yaml | 43 +++++++++++++++++++++++++++++++++++++ package.json | 5 +++-- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/bump.yaml diff --git a/.github/workflows/bump.yaml b/.github/workflows/bump.yaml new file mode 100644 index 00000000..3fed0328 --- /dev/null +++ b/.github/workflows/bump.yaml @@ -0,0 +1,43 @@ +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 diff --git a/package.json b/package.json index fa559497..af67c1ae 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,12 @@ "dev": "yarn cli prepare-link && yarn watch:all; yarn cli prepare-link --revert", "format": "yarn lint --fix", "lint": "eslint ./packages/**/*.{ts,js} --quiet", - "loop": "yarn workspaces foreach -Apti --include \"@datadog/*\" --exclude \"@datadog/build-plugins\"", + "loop-published": "yarn workspaces foreach -A --include \"@datadog/*\" --exclude \"@datadog/build-plugins\"", + "loop": "yarn loop-published -pti", "oss": "yarn cli oss -d packages -l mit", "publish:all": "yarn loop --no-private npm publish", "typecheck:all": "yarn workspaces foreach -Apti run typecheck", - "version:all": "yarn loop version --deferred ${0} && yarn version apply --all", + "version:all": "yarn loop-published version ${0} --immediate", "watch:all": "yarn loop run watch" }, "husky": {