build: use pnpm instead of yarn

This commit is contained in:
Johannes Loher 2023-03-23 00:47:54 +01:00
parent 5ee63fbadc
commit 4ad1b6a75e
29 changed files with 4798 additions and 8657 deletions

View file

@ -26,35 +26,41 @@ stages:
image: node:lts
cache: &global_cache
key:
files:
- pnpm-lock.yaml
paths:
- .yarn/cache
- .pnpm-store
.pnpm_install: &pnpm_install
- corepack enable
- corepack prepare pnpm@latest --activate
- pnpm config set store-dir .pnpm-store
- pnpm install --frozen-lockfile
.pnpm_job: &pnpm_job
before_script:
- *pnpm_install
cache:
<<: *global_cache
lint:
stage: check
before_script:
- yarn install --immutable
<<: *pnpm_job
script:
- yarn lint
cache:
<<: *global_cache
- pnpm lint
typecheck:
stage: check
before_script:
- yarn install --immutable
<<: *pnpm_job
script:
- yarn typecheck
cache:
<<: *global_cache
- pnpm typecheck
test:
stage: check
before_script:
- yarn install --immutable
<<: *pnpm_job
script:
- yarn test:ci
cache:
<<: *global_cache
- pnpm test:ci
artifacts:
when: always
reports:
@ -71,22 +77,20 @@ reuse:
commitlint:
stage: check
before_script:
- yarn install --immutable
<<: *pnpm_job
script:
- yarn run commitlint --from $CI_MERGE_REQUEST_DIFF_BASE_SHA
- pnpm exec commitlint --from $CI_MERGE_REQUEST_DIFF_BASE_SHA
rules:
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_DIFF_BASE_SHA"
build:
stage: build
<<: *pnpm_job
before_script:
- yarn install --immutable
- *pnpm_install
- if [[ ! -z ${CI_COMMIT_TAG+x} ]]; then export NODE_ENV=production; fi
script:
- yarn build
cache:
<<: *global_cache
- pnpm build
artifacts:
paths:
- dist
@ -109,12 +113,9 @@ publish-artifacts:
changelog:
stage: prepare-release
before_script:
- yarn install --immutable
<<: *pnpm_job
script:
- yarn changelog
cache:
<<: *global_cache
- pnpm changelog
artifacts:
paths:
- CHANGELOG.md
@ -123,8 +124,9 @@ changelog:
.release-template: &release-template
stage: release
<<: *pnpm_job
before_script:
- yarn install --immutable
- *pnpm_install
- apt update
- apt install --yes jq
- REPOSITORY_URL=$(echo "${CI_REPOSITORY_URL}" | sed -e "s|gitlab-ci-token:.*@|${RELEASE_TOKEN}:${RELEASE_TOKEN_SECRET}@|g")
@ -133,10 +135,8 @@ changelog:
- git config user.email $GITLAB_USER_EMAIL
- git branch -D ci-processing || true
- git checkout -b ci-processing
cache:
<<: *global_cache
script: |
yarn bump-version --release=${RELEASE_TYPE}
pnpm bump-version --release=${RELEASE_TYPE}
RELEASE_VERSION=$(jq -r '.version' < package.json)
git add package.json $PACKAGE_TYPE.json
git --no-pager diff