Skip to content

chore: add makefile #2224

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/check-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
node-version: 20
check-latest: true
cache: 'pnpm'
- run: pnpm install
- run: make install-dependencies
- name: Check title
run: |
title=$(cat <<- "EOF"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
id: pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: pnpm install
run: make install-dependencies
- name: Build doc
run: pnpm run doc
run: make doc
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
registry-url: 'https://registry.npmjs.org/'
node-version: 20
check-latest: true
- run: pnpm install
- run: pnpm run build
- run: make install-dependencies
- run: make build

- name: Version package with lerna
run: pnpm lerna version -y --no-private --force-git-tag --create-release github
run: make publish
env:
HUSKY: 0
GH_TOKEN: ${{ secrets.GH_TOKEN }}

# https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
- name: Publish to npm
run: pnpm -r publish --access public --tag latest
run: make publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
node-version: 20
check-latest: true
cache: 'pnpm'
- run: pnpm install
- run: pnpm typecheck
- run: make install-dependencies
- run: make typing
lint:
runs-on: ubuntu-24.04
steps:
Expand All @@ -32,8 +32,8 @@ jobs:
node-version: 20
check-latest: true
cache: 'pnpm'
- run: pnpm install
- run: pnpm run build
- run: make install-dependencies
- run: make build
- run: pnpm run lint
test:
runs-on: ubuntu-24.04
Expand All @@ -54,7 +54,7 @@ jobs:
node-version: ${{ matrix.node }}
check-latest: true
cache: 'pnpm'
- run: pnpm install
- run: pnpm run build
- run: make install-dependencies
- run: make build
- run: pnpm run test:coverage --environment ${{ matrix.test-environment }}
- uses: codecov/[email protected]
47 changes: 47 additions & 0 deletions Makefile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the github actions be also updated to use this definition? It would avoid the drifts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
WORKDIR = $(shell pwd)

LIBRARIES = $(shell find packages packages_generated -mindepth 1 -maxdepth 1 -type d)

build:
pnpm turbo build

install-dependencies:
pnpm install

format:
pnpm run format

format-check:
pnpm run format:check

typing:
pnpm turbo typecheck

lint:
pnpm turbo lint

test:
pnpm turbo test

test-coverage:
pnpm run test:coverage

doc:
pnpm run doc

prebuild:
pnpm run prebuild

generate-alias:
pnpm run generateAlias

generate-packages:
pnpm run generatePackages

generate-global-sdk-package:
pnpm run generateGlobalSdkPackage

publish: install-dependencies
pnpm run build
pnpm lerna changed
pnpm exec lerna publish -y --registry $(NPM_PUBLISH_REGISTRY) --ignore-scripts
Loading