From e8b27eecb2be57f6b018f010381f5277783c0498 Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Sat, 19 Jul 2025 00:20:08 +0700 Subject: [PATCH] :green_heart: (merge build process) --- .gitlab-ci.yml | 50 ++++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58eff97..eb29207 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,39 +1,29 @@ -stages: - - build - - release - -variables: - BUN_VERSION: "1.2.17" - -build_app: - stage: build - image: oven/bun:${BUN_VERSION} - script: - - bun i - - bun run route:sync - - bun build --compile --minify-whitespace --minify-syntax --target bun --outfile "server-compiled" ./src/index.ts - artifacts: - paths: - - server-compiled - expire_in: 1 hour +workflow: rules: - if: $CI_COMMIT_TAG -create_release: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - needs: - - job: build_app - artifacts: true +stages: + - build_and_release + +build-and-release: + stage: build_and_release + image: oven/bun:latest script: - - echo "Creating release and uploading server-compiled..." + - echo "🚀 Memulai proses build untuk tag $CI_COMMIT_TAG..." + - bun install --frozen-lockfile + - bun run route:sync + - bun build --compile --minify-whitespace --minify-syntax --target bun --outfile "server-compiled" ./src/index.ts + - echo "✅ Build selesai. File 'server-compiled' telah dibuat." release: - name: "Release $CI_COMMIT_TAG" tag_name: "$CI_COMMIT_TAG" - description: "Automated release for commit $CI_COMMIT_SHA" + name: "Release $CI_COMMIT_TAG" + description: "Rilis otomatis berisi aplikasi server yang sudah dicompile." assets: links: - name: "server-compiled" - url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/raw/server-compiled" - rules: - - if: $CI_COMMIT_TAG + url: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/server-compiled" + link_type: "other" + artifacts: + paths: + - server-compiled + expire_in: never