From 93c1caececed0ec8f9f3bf6531a15bdcebd4676e Mon Sep 17 00:00:00 2001 From: jeffgreiner-eaton Date: Wed, 17 Apr 2024 08:39:36 -0400 Subject: [PATCH 1/2] Add blui-ci github workflow --- .circleci/config.yml | 65 --------------------------- .github/workflows/blui-ci.yml | 83 +++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 65 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/blui-ci.yml 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..de6b394 --- /dev/null +++ b/.github/workflows/blui-ci.yml @@ -0,0 +1,83 @@ +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 From 648130a8923205df9e0daefa275a6477cb5d0910 Mon Sep 17 00:00:00 2001 From: jeffgreiner-eaton Date: Wed, 17 Apr 2024 09:19:08 -0400 Subject: [PATCH 2/2] align indents --- .github/workflows/blui-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/blui-ci.yml b/.github/workflows/blui-ci.yml index de6b394..fe90da9 100644 --- a/.github/workflows/blui-ci.yml +++ b/.github/workflows/blui-ci.yml @@ -21,8 +21,7 @@ jobs: strategy: matrix: - node-version: [18.x] - + node-version: [18.x] steps: - name: Checkout uses: actions/checkout@v4 @@ -40,7 +39,6 @@ jobs: strategy: matrix: node-version: [18.x] - steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }}