Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Release process update #138

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/bump.yaml
Original file line number Diff line number Diff line change
@@ -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='[email protected]',
GIT_COMMITTER_EMAIL='[email protected]',

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
5 changes: 3 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
workflow_dispatch: {} # Allow for manual trigger.

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version-file: 'package.json'

- run: yarn config set npmAuthToken $YARN_NPM_AUTH_TOKEN
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.PUBLISH_NPM_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down