diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0c4ff26..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,65 +0,0 @@ -version: 2.1 -orbs: - gh: circleci/github-cli@1.0.3 -jobs: - build: - docker: - - image: cimg/node:16.19.1-browsers - steps: - - checkout - - restore_cache: - keys: - - v1-dependencies-{{ checksum "yarn.lock" }} - - run: - name: Install Dependencies - command: | - yarn install --frozen-lockfile - - save_cache: - name: Save Cache - paths: - - node_modules - key: v1-dependencies-{{ checksum "yarn.lock" }} - - run: - name: Prettier Check - command: yarn prettier:check - - run: - name: Build - command: yarn build - - run: - name: Verify Artifacts - command: yarn test - - persist_to_workspace: - root: . - paths: - - dist - - publish: - docker: - - image: cimg/node:16.19.1-browsers - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Authenticate with registry - command: | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc - - run: - name: Publish @brightlayer-ui/react-native-themes - command: | - yarn publish:package -b $CIRCLE_BRANCH - -workflows: - version: 2 - themes: - jobs: - - build - - publish: - requires: - - build - filters: - branches: - only: - - master - - dev diff --git a/.github/workflows/blui-ci.yml b/.github/workflows/blui-ci.yml new file mode 100644 index 0000000..fe90da9 --- /dev/null +++ b/.github/workflows/blui-ci.yml @@ -0,0 +1,81 @@ +name: CI Run + +on: + push: + branches: [ "dev", "master" ] + pull_request: + branches: [ "dev", "master" ] + pull_request_target: + types: + - opened + branches: + - '*/*' + +permissions: + pull-requests: write + contents: read + +jobs: + prettier: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + - run: yarn install --frozen-lockfile + - run: yarn prettier:check + + build_theme_verify_artifacts: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + - run: yarn --frozen-lockfile + - run: yarn build + - name: Save build + uses: actions/upload-artifact@v3 + with: + name: dist + if-no-files-found: error + path: dist + - run: yarn test + + publish_react_native_theme: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }} + needs: build_theme_verify_artifacts + strategy: + matrix: + node-version: [18.x] + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }} + steps: + - uses: actions/checkout@v4 + - name: Download dist + uses: actions/download-artifact@v3 + with: + name: dist + path: dist + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + - run: yarn --frozen-lockfile + - run: yarn publish:package -b ${{env.BRANCH}} \ No newline at end of file