Skip to content

Commit

Permalink
Merge pull request #705 from pixiv/revert-704-revert-702-naporitan/us…
Browse files Browse the repository at this point in the history
…e-pnpm
  • Loading branch information
naporin0624 authored Mar 5, 2025
2 parents 935db50 + 33733b2 commit 859e48a
Show file tree
Hide file tree
Showing 41 changed files with 26,144 additions and 32,164 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'
- uses: preactjs/compressed-size-action@v2
with:
install-script: 'yarn install'
install-script: 'pnpm install --frozen-lockfile'
build-script: 'build'
clean-script: 'clean'

Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/docs-hosting-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ jobs:
# url: TODO: Edit after

steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Get pnpm store path
id: pnpm-store-path
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
# charcoal packages
- run: yarn install --immutable
- run: yarn build
- run: pnpm install --frozen-lockfile
- run: pnpm build
# docs
- run: yarn storybook:build
- run: pnpm storybook:build

- id: auth
uses: google-github-actions/auth@v1
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/docs-hosting-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ jobs:
url: ${{ steps.preview_deploy.outputs.details_url }}

steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Get pnpm store path
id: pnpm-store-path
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
# charcoal packages
- run: yarn install --immutable
- run: yarn build
- run: pnpm install --frozen-lockfile
- run: pnpm build
# docs
- run: yarn storybook:build
- run: pnpm storybook:build

- id: auth
uses: google-github-actions/auth@v1
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'

- name: Prepare deps
run: |
yarn install --immutable --inline-builds
yarn build
pnpm install --frozen-lockfile
pnpm build
- name: Output files
run: |
yarn storybook:build -o public-pages --quiet
pnpm storybook:build -o public-pages --quiet
cp .storybook/badge.svg public-pages/storybook-badge.svg
mv pages public-pages/docs
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,32 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ env.TARGET_BRANCH }}
- uses: pnpm/action-setup@v4
with:
version: '10.4.0'

- uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Prepare deps
run: |
yarn install --immutable --inline-builds
yarn workspaces foreach -vptR --from @charcoal-ui/icons-cli run build
- name: Build icons
run: pnpm --filter @charcoal-ui/icons-cli run build

- name: Export
- name: Export icons
env:
FIGMA_FILE_URL: ${{ secrets.FIGMA_FILE_URL }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
run: yarn icons-cli figma:export
run: pnpm icons-cli figma:export

- name: Optimize
run: yarn icons-cli svg:optimize --ignoreFile ./misc/icons-cli-denylist
- name: Optimize icons
run: pnpm icons-cli svg:optimize --ignoreFile ./misc/icons-cli-denylist

- name: Generate source
run: yarn icons-cli files:generate
- name: Generate icon files
run: pnpm icons-cli files:generate

- name: Generate github token
id: generate_token
Expand All @@ -48,10 +52,10 @@ jobs:
app_id: ${{ secrets.CHARCOAL_BOT_APP_ID }}
private_key: ${{ secrets.CHARCOAL_BOT_PRIVATE_KEY }}

- name: Create a Pull Request
- name: Create Pull Request for updated icons
env:
GITHUB_ACCESS_TOKEN: ${{ steps.generate_token.outputs.token }}
GITHUB_REPO_OWNER: pixiv
GITHUB_REPO_NAME: charcoal
GITHUB_DEFAULT_BRANCH: ${{ env.TARGET_BRANCH }}
run: yarn icons-cli github:pr
run: pnpm icons-cli github:pr
21 changes: 12 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,42 @@ jobs:
contents: write
id-token: write
steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Get pnpm store path
id: pnpm-store-path
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Checkout repository
uses: actions/checkout@v3

- name: setup pnpm
uses: pnpm/action-setup@v4
with:
version: '10.4.0'

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- name: Install node dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Set git username and email
run: |
git config --local user.email "[email protected]"
git config --local user.name "actions-user"
- name: Set package version
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: yarn lerna version ${{ github.event.inputs.version }} --no-push --force-publish --yes
run: pnpm lerna version ${{ github.event.inputs.version }} --no-push --force-publish --yes

- name: git push version up commits
run: |
git push origin ${{ github.ref_name }}
- name: Build & Publish to npmjs
run: yarn release -y from-package --dist-tag ${{ github.event.inputs.release_tag }}
run: pnpm release -y from-package --dist-tag ${{ github.event.inputs.release_tag }}
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37 changes: 22 additions & 15 deletions .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ jobs:
with:
path: __image_snapshots__
key: image-snapshots-${{ steps.commit-hash.outputs.hash }}
- name: setup pnpm
uses: pnpm/action-setup@v4
with:
version: '10.4.0'
- uses: actions/setup-node@v4
if: steps.cache-image-snapshots.outputs.cache-hit != 'true'
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm
- name: Install dependencies
if: steps.cache-image-snapshots.outputs.cache-hit != 'true'
run: yarn install --immutable --inline-builds
run: pnpm install --frozen-lockfile
- name: Cache Playwright runners
if: steps.cache-image-snapshots.outputs.cache-hit != 'true'
uses: actions/cache@v4
Expand All @@ -44,15 +48,13 @@ jobs:
key: ${{ runner.os }}-playwright-runner
- name: Install Playwright
if: steps.cache-image-snapshots.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
run: pnpm playwright install --with-deps
- name: Build Storybook
if: steps.cache-image-snapshots.outputs.cache-hit != 'true'
run: |
yarn build
yarn storybook:build --quiet
run: pnpm build
- name: Serve Storybook and run tests
if: steps.cache-image-snapshots.outputs.cache-hit != 'true'
run: yarn test:image-snapshot --updateSnapshot
run: pnpm test:image-snapshot --updateSnapshot
- name: Upload base branch snapshots
uses: actions/upload-artifact@v4
with:
Expand All @@ -67,24 +69,29 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: setup pnpm
uses: pnpm/action-setup@v4
with:
version: '10.4.0'

- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --immutable --inline-builds
run: pnpm install --frozen-lockfile
- name: Cache Playwright runners
uses: actions/cache@v4
with:
path: |
/home/runner/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-runner
- name: Install Playwright
run: yarn playwright install --with-deps
run: pnpm playwright install --with-deps
- name: Build Storybook
run: |
yarn build
yarn storybook:build --quiet
run: pnpm build
- name: Check label
uses: actions/github-script@v7
id: label-checking
Expand Down Expand Up @@ -117,10 +124,10 @@ jobs:
path: __image_snapshots__/
- name: Serve Storybook and run tests
if: steps.label-checking.outputs.result != 'true'
run: yarn test:image-snapshot
run: pnpm test:image-snapshot
- name: Serve Storybook and take new image snapshots
if: steps.label-checking.outputs.result == 'true'
run: yarn test:image-snapshot --updateSnapshot
run: pnpm test:image-snapshot --updateSnapshot
- name: Archive image snapshot diffs
uses: actions/upload-artifact@v4
if: failure() && steps.label-checking.outputs.result != 'true'
Expand Down
Loading

0 comments on commit 859e48a

Please sign in to comment.