From 21a62e2222db245e27323fa3ecbb860e34a21209 Mon Sep 17 00:00:00 2001 From: Jakub007d Date: Tue, 25 Nov 2025 15:36:58 +0100 Subject: [PATCH] fix: fixing ci --- .github/workflows/ci.yml | 52 +++++++++++++ .github/workflows/main.yml | 99 ------------------------- .github/workflows/release.yml | 53 +++++++++++++ packages/ant-component-mapper/README.md | 2 +- 4 files changed, 106 insertions(+), 100 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..690468375 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI Checks + +on: + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + ci-checks: + runs-on: ubuntu-latest + name: CI Checks (Build, Lint, Test, Release Dry-Run) + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Derive appropriate SHAs for base and head for nx affected commands + uses: nrwl/nx-set-shas@v4 + with: + main-branch-name: 'master' + + - name: Run build on affected projects + run: npx nx affected --target=build --parallel=3 + continue-on-error: false + + - name: Run lint on affected projects + run: npx nx affected --target=lint --parallel=3 + continue-on-error: false + + - name: Run typecheck on affected projects + run: npx nx affected --target=typecheck --parallel=3 + continue-on-error: false + + - name: Clear Jest cache + run: npx jest --clearCache + + - name: Run tests on affected projects + run: npx nx affected --target=test --parallel=3 --coverage + continue-on-error: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 0ef256577..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,99 +0,0 @@ -on: - pull_request: - branches: - - master - push: - branches: - - master - -permissions: - id-token: write - contents: write - -jobs: - # Job that runs for both PR and merge - ci-checks: - runs-on: ubuntu-latest - name: CI Checks (Build, Lint, Test, Release Dry-Run) - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Derive appropriate SHAs for base and head for nx affected commands - uses: nrwl/nx-set-shas@v4 - with: - main-branch-name: 'master' - - - name: Run build on affected projects - run: npx nx affected --target=build --parallel=3 - continue-on-error: false - - - name: Run lint on affected projects - run: npx nx affected --target=lint --parallel=3 - continue-on-error: false - - - name: Run typecheck on affected projects - run: npx nx affected --target=typecheck --parallel=3 - continue-on-error: false - - - name: Clear Jest cache - run: npx jest --clearCache - - - name: Run tests on affected projects - run: npx nx affected --target=test --parallel=3 --coverage - continue-on-error: false - - # Job that runs ONLY after merge (on push to master) - release: - if: github.event_name != 'pull_request' - needs: ci-checks - runs-on: ubuntu-latest - name: Release - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ssh-key: ${{ secrets.BOT_SSH_KEY }} - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - registry-url: 'https://registry.npmjs.org' - - - name: Install dependencies - run: npm ci - - - name: Derive appropriate SHAs for base and head for nx affected commands - uses: nrwl/nx-set-shas@v4 - with: - main-branch-name: 'master' - - - name: Build affected packages - run: npx nx affected --target=build --parallel=3 - - - name: 🚀 Run Nx Release - run: | - echo "registry=https://registry.npmjs.org/" >> .npmrc - git config --global user.email "${{ secrets.RELEASE_EMAIL }}" - git config --global user.name "${{ secrets.RELEASE_USERNAME }}" - - npx nx release -y - env: - # NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - NPM_CONFIG_PROVENANCE: true - npm_config_legacy_peer_deps: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..91caa65ae --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + branches: + - master + workflow_dispatch: + +permissions: + id-token: write + contents: write + +jobs: + release: + runs-on: ubuntu-latest + name: Release Packages + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ssh-key: ${{ secrets.BOT_SSH_KEY }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Derive appropriate SHAs for base and head for nx affected commands + uses: nrwl/nx-set-shas@v4 + with: + main-branch-name: 'master' + + - name: Build affected packages + run: npx nx affected --target=build --parallel=3 + + - name: 🚀 Run Nx Release + run: | + echo "registry=https://registry.npmjs.org/" >> .npmrc + git config --global user.email "${{ secrets.RELEASE_EMAIL }}" + git config --global user.name "${{ secrets.RELEASE_USERNAME }}" + + npx nx release -y + env: + # NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + NPM_CONFIG_PROVENANCE: true + npm_config_legacy_peer_deps: false diff --git a/packages/ant-component-mapper/README.md b/packages/ant-component-mapper/README.md index e3271de73..fd372a829 100644 --- a/packages/ant-component-mapper/README.md +++ b/packages/ant-component-mapper/README.md @@ -104,4 +104,4 @@ We welcome any community contribution. Don't be afraid to report bug or to creat ### LICENSE -Apache License 2.0 \ No newline at end of file +Apache License 2.0