Skip to content

Commit

Permalink
rebase with main
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaypratap003 committed Jun 1, 2024
2 parents 420b6e0 + 7139d5b commit cbfd3ec
Show file tree
Hide file tree
Showing 253 changed files with 9,862 additions and 5,361 deletions.
65 changes: 65 additions & 0 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Set up and build project
inputs:
skip-build:
description: Skip the build step
required: false
default: 'false'
skip-build-cache:
description: Skip the build cache step
required: false
default: 'false'
runs:
using: composite
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true

- name: Get Yarn configuration
id: yarn-config
shell: bash
run: |
echo "cache-directory=$(yarn cache dir)" >> $GITHUB_OUTPUT
# TODO: This can be simplified to use the `cache` option of the `actions/setup-node` action when it supports Corepack.
# See: https://github.com/actions/setup-node/issues/531
- uses: actions/cache@v4
name: Setup Yarn cache
with:
# Also cache Cypress binary.
path: |
~/.cache/Cypress
${{ steps.yarn-config.outputs.cache-directory }}
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile

- uses: actions/cache@v4
if: inputs.skip-build != 'true' && inputs.skip-build-cache != 'true'
id: cache-build
name: Cache build
with:
path: |
packages/*/dist
packages/*/next
packages/*/deprecated
packages/*/components
packages/react-styles/css
packages/react-core/layouts
packages/react-core/helpers
key: ${{ runner.os }}-build-${{ hashFiles('yarn.lock', '**/package.json', 'packages/**', '!**/node_modules', '!**/dist') }}

- name: Run build
if: inputs.skip-build != 'true' && steps.cache-build.outputs.cache-hit != 'true'
shell: bash
run: yarn build && yarn build:umd
env:
# Disable V8 compile cache to hard crashes in Node.js. This can likely be removed once upgraded to the next LTS version (version 22).
# See: https://github.com/nodejs/node/issues/51555
DISABLE_V8_COMPILE_CACHE: 1
8 changes: 4 additions & 4 deletions .github/promote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# Update their versions and changelogs according to angular commit guidelines
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit

# if [[ ! -z "${CORE_VERSION}" ]]; then
# echo "Updating to @patternfly/patternfly: ${CORE_VERSION}"
# npm pkg set dependencies.@patternfly/patternfly=${CORE_VERSION} --workspace @patternfly/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${CORE_VERSION} --workspace @patternfly/react-core --workspace @patternfly/react-styles --workspace @patternfly/react-tokens --workspace @patternfly/react-icons
# if [[ ! -z "${PATTERNFLY_VERSION}" ]]; then
# echo "Updating to @patternfly/patternfly: ${PATTERNFLY_VERSION}"
# npm pkg set dependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-docs
# npm pkg set devDependencies.@patternfly/patternfly=${PATTERNFLY_VERSION} --workspace @patternfly/react-core --workspace @patternfly/react-styles --workspace @patternfly/react-tokens --workspace @patternfly/react-icons
# fi

# publish to npm
Expand Down
88 changes: 5 additions & 83 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,15 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
"config:recommended"
],
"enabledManagers": ["npm"],
"rangeStrategy": "bump",
"packageRules": [
{
"packagePatterns": ["*"],
"excludePackagePatterns": [
"@babel/*",
"@octokit/rest",
"@patternfly/patternfly",
"@patternfly/patternfly-a11y",
"@patternfly/documentation-framework",
"@rollup/*",
"@testing-library/jest-dom",
"@testing-library/user-event",
"@types/jest",
"@types/react",
"@types/react-dom",
"@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser",
"eslint",
"eslint-plugin-prettier",
"eslint-plugin-react",
"fs-extra",
"lint-staged",
"mutation-observer",
"plop",
"prettier",
"react-dropzone",
"rollup",
"rollup-plugin-scss",
"rollup-plugin-terser",
"shx",
"surge",
"ts-patch"
"matchUpdateTypes": [
"major"
],
"enabled": false
},
{
"groupName": "devDependencies",
"matchDatasources": ["npm"],
"automerge": true,
"matchPackagePatterns": [
"@babel/*",
"@octokit/rest",
"@patternfly/patternfly-a11y",
"@patternfly/documentation-framework",
"@rollup/*",
"@testing-library/jest-dom",
"@testing-library/react-hooks",
"@testing-library/user-event",
"@types/jest",
"@types/react",
"@types/react-dom",
"@typescript-eslint/eslint-plugin",
"@typescript-eslint/parser",
"eslint",
"eslint-plugin-prettier",
"eslint-plugin-react",
"focus-trap",
"fs-extra",
"lint-staged",
"mutation-observer",
"plop",
"prettier",
"react-dropzone",
"rollup",
"rollup-plugin-scss",
"rollup-plugin-terser",
"shx",
"surge",
"ts-patch"
]
},
{
"matchDatasources": ["npm"],
"matchPackageNames": [
"focus-trap",
"react-dropzone"
]
},
{
"matchDatasources": ["npm"],
"matchPackageNames": [
"@patternfly/patternfly"
],
"automerge": true,
"followTag": "prerelease"
}
]
}
28 changes: 0 additions & 28 deletions .github/stale.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .github/upload-preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const fs = require('fs');
const path = require('path');
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN });
Expand All @@ -7,11 +6,9 @@ const publishFn = surge().publish();

// From github actions
const ghrepo = process.env.GITHUB_REPOSITORY || '';

const owner = process.env.CIRCLE_PROJECT_USERNAME || ghrepo.split('/')[0]; // patternfly
const repo = process.env.CIRCLE_PROJECT_REPONAME || ghrepo.split('/')[1];
const prnum = process.env.CIRCLE_PR_NUMBER || process.env.GH_PR_NUM;
const prbranch = process.env.CIRCLE_BRANCH || process.env.GITHUB_REF.split('/').pop();
const [owner, repo] = ghrepo.split('/');
const prnum = process.env.GH_PR_NUM;
const prbranch = process.env.GITHUB_REF.split('/').pop();

const uploadFolder = process.argv[2];
if (!uploadFolder) {
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/add-new-issues-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Add new issues to PatternFly Issues project

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.3.0
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/patternfly/projects/7
github-token: ${{ secrets.GH_PROJECTS }}
49 changes: 49 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Documentation
on:
pull_request_target:
workflow_call:
secrets:
SURGE_LOGIN:
required: true
SURGE_TOKEN:
required: true
GH_PR_TOKEN:
required: true
jobs:
deploy:
name: Build, test & deploy
runs-on: ubuntu-latest
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
GH_PR_NUM: ${{ github.event.number }}
steps:
- name: Check out project from PR branch
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
# Checkout the merge commit so that we can access the PR's changes.
# This is nessesary because `pull_request_target` checks out the base branch (e.g. `main`) by default.
ref: refs/pull/${{ env.GH_PR_NUM }}/head

- name: Check out project
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v4

- name: Set up and build project
uses: ./.github/actions/setup-project

- name: Build documentation
run: yarn build:docs

- name: Upload documentation
if: always()
run: node .github/upload-preview.js packages/react-docs/public

- name: Run accessibility tests
run: yarn serve:docs & yarn test:a11y

- name: Upload accessibility results
if: always()
run: node .github/upload-preview.js packages/react-docs/coverage
4 changes: 1 addition & 3 deletions .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: Add relevant issues to extensions project board

on:
issues:
types:
- labeled

jobs:
add-to-extensions:
if: github.event.label.name == 'extension'
name: Add issue to extensions board
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.3.0
- uses: actions/add-to-project@v1.0.1
with:
project-url: https://github.com/orgs/patternfly/projects/12
github-token: ${{ secrets.GH_PROJECTS }}
Loading

0 comments on commit cbfd3ec

Please sign in to comment.