diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml deleted file mode 100644 index 3d590cf5d..000000000 --- a/.github/workflows/chromatic.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: "Chromatic Deployment" - -# Triggers on Push event on all branches, excluding the 'prod' branch -on: - push: - branches-ignore: - - prod - -jobs: - chromatic-deployment: - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Checkout the repository code - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install project dependencies using Yarn - - name: Install dependencies - run: yarn - - # Step 4: Publish the project to Chromatic - - name: Publish to Chromatic - uses: chromaui/action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} # Authenticate using the GitHub token - projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} # Provide the Chromatic project token for authentication diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml deleted file mode 100644 index f389bdddc..000000000 --- a/.github/workflows/commitlint.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Lint PR commit - -# Triggers on pull requests with specific types -on: - pull_request: - types: - - reopened - - opened - - edited - - synchronize - -jobs: - main: - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Use the 'amannn/action-semantic-pull-request' action to validate the PR commit - - uses: amannn/action-semantic-pull-request@v3.4.2 - with: - validateSingleCommit: true # Specify to validate a single commit - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Authenticate using the GitHub token diff --git a/.github/workflows/gh-release-test.yml b/.github/workflows/gh-release-test.yml index 635f3f812..5d6d9972f 100644 --- a/.github/workflows/gh-release-test.yml +++ b/.github/workflows/gh-release-test.yml @@ -6,34 +6,35 @@ on: - "*" jobs: - version_check_and_tag: + create_version_matrix: runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} steps: # Step 1: Check out the repository code - - name: Checkout + - name: Checkout Code uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set Current Versions - id: set_versions + - name: Create Version Matrix + id: set-matrix run: | - CURRENT_VERSIONS="" + CURRENT_VERSIONS="[" for package_json in $(find ./packages -name package.json); do version=$(jq -r .version $package_json) - CURRENT_VERSIONS="${CURRENT_VERSIONS}${version}," + CURRENT_VERSIONS="${CURRENT_VERSIONS}{\"version\":\"${version}\"}," done - CURRENT_VERSIONS=${CURRENT_VERSIONS%,} # Remove trailing comma + CURRENT_VERSIONS="${CURRENT_VERSIONS%,}]" # Remove trailing comma echo "CURRENT_VERSIONS=${CURRENT_VERSIONS}" >> $GITHUB_ENV - - name: Run Version Check and Tag for Each Version - run: | - for version in $(echo $CURRENT_VERSIONS | tr ',' ' '); do - echo "Creating job for version $version..." - echo "VERSION=${version}" >> $GITHUB_ENV - done - - - name: Create Release - run: | - echo "Running release job for individual tag ${{ steps.set_versions.outputs.version }}" + create_github_release: + needs: create_version_matrix + runs-on: ubuntu-latest + strategy: + matrix: + cfg: ${{fromJson(needs.create_version_matrix.outputs.CURRENT_VERSIONS)}} + steps: + - run: | + echo "Run GH release for ${{ matrix.cfg.version }}" diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml deleted file mode 100644 index cfc324882..000000000 --- a/.github/workflows/github-release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Create release - -# Triggers on pushes to tags -on: - push: - tags: - - "*" # This workflow triggers on any tag push - -jobs: - release: - name: Release pushed tag - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Debugging step to display a message - - name: Debugging step - run: echo "Creating GitHub release workflow is running!" - - # Step 2: Create a GitHub release - - name: Create release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Authenticate using the GitHub token - tag: ${{ github.ref }} # Get the tag name from the push event - run: | - gh release create "$tag" \ - --repo="$GITHUB_REPOSITORY" \ - --title="${GITHUB_REPOSITORY#*/} ${tag#refs/tags/v}" \ - --generate-notes diff --git a/.github/workflows/namespace-check.yml b/.github/workflows/namespace-check.yml deleted file mode 100644 index 013fd3c52..000000000 --- a/.github/workflows/namespace-check.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "Namespace Check" - -# Triggers on push event on all branches, excluding the 'prod' branch -on: - push: - branches-ignore: - - prod # Exclude the 'prod' branch from triggering this workflow - -jobs: - namespace-check: - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Check out the repository code - - name: Checkout code - uses: actions/checkout@v3 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install project dependencies using Yarn - - name: Install dependencies - run: yarn - - # Step 4: Build the component library in 'dist/' directory - - name: Build component library in dist/ - run: yarn build - - # Step 5: Run the Namespace Checking script - - name: Namespace Checking - run: yarn namespace-check diff --git a/.github/workflows/push-tests.yml b/.github/workflows/push-tests.yml deleted file mode 100644 index 99cc79d41..000000000 --- a/.github/workflows/push-tests.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Push Tests - -# Workflow event triggers -on: - push: - branches: - - main # Triggered on pushes to the 'main' branch - pull_request: - branches: "*" # Triggered on pull requests for any branch - -jobs: - lint: - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - steps: - # Step 1: Check out the repository code - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install project dependencies using Yarn - - name: Install dependencies - run: yarn - - # Step 4: Build the component library in 'dist/' directory - - name: Build component library in dist/ - run: yarn build - - # Step 5: Run linting - - name: Lint - run: yarn lint - - test: - runs-on: ubuntu-latest - steps: - # Step 1: Check out the repository code - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install project dependencies using Yarn - - name: Install dependencies - run: yarn - - # Step 4: Run tests - - name: Test - run: yarn test - - build: - runs-on: ubuntu-latest - steps: - # Step 1: Check out the repository code - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install project dependencies using Yarn - - name: Install dependencies - run: yarn - - # Step 4: Build - - name: Build - run: yarn build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 004828cda..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Release - -# triggers on pushes to the 'prod' branch -on: - push: - # NOTE(thuang): Since REGEX is not supported for branches, we cannot target - # any versioned branch: "+([0-9])?(.{+([0-9]),x}).x" as specified in - # .releaserc.js. So we'll need to manually add such branch's name here manually - branches: - - prod - -jobs: - release: - name: Release - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Check out the repository code - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js and Cache yarn - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Set up npm and authentication - - name: "Setup npm" - run: | - npm set "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - # Step 4: Ensure npm access - - name: Ensure NPM access - run: npm whoami - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - # Step 5: Install project dependencies using Yarn - - name: Install dependencies - run: yarn ci - - # Step 6: Build the component library in 'dist/' directory - - name: Build component library in dist/ - run: yarn build - - # Step 7: Configure git user for pushing release changes back to prod branch - - name: Config git user - run: | - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor }}@users.noreply.github.com" - - # Step 8: Lerna Version - - name: Lerna Version - env: - GITHUB_TOKEN: ${{ secrets.SDS_LERNA_VERSION_PAT }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: yarn version:ci - - # Step 9: Commit changes - - name: Commit changes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: stefanzweifel/git-auto-commit-action@v4 - with: - branch: ${{ github.head_ref }} - - # Step 10: Publish NPM packages - - name: Lerna Publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - run: yarn publish:ci - - # Step 11: Check out the main branch - # to create a pull request to push the release modifications back to the main - - name: Checkout main - uses: actions/checkout@v3 - with: - ssh-key: "${{ secrets.COMMIT_KEY }}" - ref: main - - # Step 12: Reset promotion branch - - name: Reset promotion branch - run: | - git fetch origin prod:prod - git reset --hard prod - - # Step 13: Create Pull Request - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "Merge changes from prod to main" - title: "chore(release): Merge changes from prod to main" - body: | - This pull request merges changes from the prod branch to main after Lerna publish. - - ### Tip - - If you have checks that are pending due to the status not being reported, resolving the issue is possible by closing and reopening the PR. This action effectively unsticks the checks, allowing them to run as intended. [This behavior arises from the inherent limitations of GitHub Actions, where one action's execution can't directly trigger another action](https://github.com/peter-evans/create-pull-request/issues/48). - - Thus, techniques like "pushing an empty commit" or "closing and reopening the PR" help unblock the process, making the PR no longer solely reliant on action-triggered events. - branch: main-promotion - base: main - - # Step 14: Post breaking changes to a Slack channel - - name: Post breaking changes to a Slack channel - env: - SLACK_WEBHOOK_URL: ${{ secrets.SDS_BREAKING_CHANGES_SLACK_WEBHOOK }} - uses: act10ns/slack@v1 - with: - status: complete - channel: "#sci-design-system-breaking-changes" - config: .github/config/slack.yml - if: contains(toJson(github.event.commits.*.message), 'BREAKING CHANGE') diff --git a/.github/workflows/storybook-tests.yml b/.github/workflows/storybook-tests.yml deleted file mode 100644 index 2b8b01d61..000000000 --- a/.github/workflows/storybook-tests.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: "Storybook Tests" - -# Triggers on push to all branches, excluding the 'prod' branch -on: - push: - branches-ignore: - - prod # Exclude the 'prod' branch from triggering this workflow - -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Check out the repository code - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install project dependencies using Yarn - - name: Install dependencies - run: yarn - - # Step 4: Install Playwright for testing - - name: Install Playwright - run: npx playwright install --with-deps - - # Step 5: Build Storybook - - name: Build Storybook - run: yarn build-storybook --quiet - - # Step 6: Run accessibility tests on Storybook - - name: Run accessibility tests - run: yarn storybook:axeOnly - - # Step 7: Serve Storybook and run tests concurrently - - name: Serve Storybook and run tests - run: | - npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ - "npx http-server docs-build --port 6006 --silent" \ - "npx wait-on tcp:6006 && yarn test-storybook" diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml deleted file mode 100644 index a29dc6670..000000000 --- a/.github/workflows/storybook.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build and Deploy - -# Triggers on pushes to the 'main' branch -on: - push: - branches: - - main - -jobs: - build-and-deploy: - runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment - - steps: - # Step 1: Check out the repository code - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Step 2: Set up Node.js environment and cache Yarn dependencies - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".node-version" # Specify the Node.js version from '.node-version' file - cache: "yarn" # Cache Yarn dependencies for faster builds - - # Step 3: Install npm packages and build the Storybook files - - name: Install and Build - run: | - yarn - yarn build-storybook - - # Step 4: Deploy to GitHub Pages using the 'github-pages-deploy-action' - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Authenticate using the GitHub token - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs-build # The folder that the build-storybook script generates files. - CLEAN: true # Automatically remove deleted files from the deploy branch