diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7152b3b..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,107 +0,0 @@ -version: 2.1 - -orbs: - node: circleci/node@5.2.0 - -jobs: - build_and_test: - machine: - image: ubuntu-2204:2024.01.1 - steps: - - checkout - - node/install: - node-version: '22.3' - - run: - name: Install requirements - command: npm ci - - run: - name: Run tests - command: npm run test - publish_canary: - machine: - image: ubuntu-2204:2024.01.1 - steps: - - checkout - - node/install: - node-version: '22.3' - - run: - name: Install requirements - command: npm ci - - run: - name: Authenticate with NPM registry - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc - - run: - name: Publish canary package - command: | - npm publish --tag canary - if [ $? -ne 0 ]; then - echo "npm publish failed, stopping the job." - exit 1 - fi - validate_main_version: - machine: - image: ubuntu-2204:2024.01.1 - steps: - - checkout - - run: - name: Validate version - command: ./bin/ci_validate_version.sh - publish: - machine: - image: ubuntu-2204:2024.01.1 - resource_class: large - steps: - - checkout - - node/install: - node-version: '22.3' - - run: - name: Authenticate with NPM registry - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc - - run: - name: Install requirements - command: npm ci - - run: - name: Publish package - command: npm publish -workflows: - CI: - jobs: - - build_and_test - - require_approval_for_canary: - type: approval - filters: - branches: - only: - - dev - - publish_canary: - requires: - - build_and_test - - require_approval_for_canary - filters: - branches: - only: - - dev - - validate_main_version: - requires: - - build_and_test - filters: - branches: - only: - - main - - require_approval: - type: approval - filters: - branches: - only: - - main - - publish: - requires: - - build_and_test - - require_approval - - validate_main_version - filters: - tags: - only: /.*/ - branches: - only: - - main \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..84c6fb0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,13 @@ +name: ci + +on: + pull_request: + branches: + - "**" + +jobs: + lint_test: + uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@push + with: + run-build: true + run-unit-tests: true diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..f217a17 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,19 @@ +name: publish + +on: + workflow_dispatch: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + lint_test: + uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@push + secrets: inherit + with: + run-build: true + run-unit-tests: true + publish: true + publish-command: | + ./bin/ci_validate_version.sh + npm publish diff --git a/.github/workflows/publish_canary.yaml b/.github/workflows/publish_canary.yaml new file mode 100644 index 0000000..5de7058 --- /dev/null +++ b/.github/workflows/publish_canary.yaml @@ -0,0 +1,14 @@ +name: publish_canary + +on: + workflow_dispatch: + +jobs: + lint_test: + uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@push + secrets: inherit + with: + run-build: true + run-unit-tests: true + publish: true + publish-command: 'npm publish --tag canary'