Skip to content

Commit

Permalink
chore(release): Port to GitLab CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidnioulz committed Oct 30, 2024
1 parent 1ef09c1 commit 6863212
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 215 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/automerge-dependabot.yml

This file was deleted.

79 changes: 0 additions & 79 deletions .github/workflows/continuous-integration.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/semantic-release.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
image: node:22

cache:
key:
files:
- pnpm-lock.yaml
paths:
- .pnpm-store
- node_modules/
- packages/*/node_modules/

before_script:
- corepack enable
- corepack prepare pnpm@latest-9 --activate
- pnpm config set store-dir .pnpm-store
- pnpm install

stages:
- test
- codegen
- release

lint:
stage: test
script:
- pnpm lint

test:
stage: test
script:
- pnpm test:coverage
- curl -Os https://cli.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov upload-process -t $CODECOV_TOKEN

build:
stage: build
script:
- pnpm build
artifacts:
paths:
- apps/*/dist
- packages/*/dist

# Continuous Delivery
semantic-release:
stage: release
script:
- pnpm build
- pnpm exec multi-semantic-release
variables:
GIT_AUTHOR_NAME: 'gitlab-ci'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: 'gitlab-ci'
GIT_COMMITTER_EMAIL: '[email protected]'
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: always

# Dependabot auto-merge functionality
# Note: GitLab has its own Dependency Scanning and Auto-merge features
# This can be configured in Settings > CI/CD > Merge request pipelines
# and Settings > General > Merge requests > Merge checks
regenerate-api:
stage: codegen
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /Bump the oas group/
script:
- pnpm api:regen
- pnpm format
- |
if [[ -n $(git status --porcelain) ]]; then
git config user.name "gitlab-ci"
git config user.email "[email protected]"
git add packages/rest/src/__generated__
git commit -nm "feat(rest): Update OpenAPI Spec generated code"
git push origin HEAD:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
fi
workflow:
rules:
- if: $CI_COMMIT_BRANCH
- if: $CI_MERGE_REQUEST_IID
4 changes: 2 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"dependsOn": ["^build", "^lint:fix"]
},
"test": {
"dependsOn": ["^build", "^test"]
"dependsOn": ["^build"]
},
"test:dev": {
"dependsOn": ["^build", "^test:dev"]
"dependsOn": ["^build"]
},
"test:changed": {
"dependsOn": ["^test:changed"],
Expand Down
2 changes: 1 addition & 1 deletion vitest.workspace.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineWorkspace } from 'vitest/config';

export default defineWorkspace(['apps/*', 'packages/*']);
export default defineWorkspace(['apps/*/', 'packages/*/']);

0 comments on commit 6863212

Please sign in to comment.