Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): corepackのバグの回避 #15387

Merged
merged 10 commits into from
Feb 3, 2025
4 changes: 4 additions & 0 deletions .github/workflows/api-misskey-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
paths:
- packages/misskey-js/**
- .github/workflows/api-misskey-js.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
report:

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/get-api-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
paths:
- packages/backend/**
- .github/workflows/get-api-diff.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
get-from-misskey:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ on:
- packages/misskey-reversi/**
- packages/shared/eslint.config.js
- .github/workflows/lint.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
pnpm_install:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/locale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
paths:
- locales/**
- .github/workflows/locale.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
locale_verify:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on-release-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

workflow_dispatch:

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
publish-misskey-js:
name: Publish misskey-js
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
# This is a waste of chromatic build quota, so we don't run storybook CI on pull requests targets master.
- master

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
build:
# chromatic is not likely to be available for fork repositories, so we disable for fork repositories.
Expand Down Expand Up @@ -47,7 +50,6 @@ jobs:
with:
node-version-file: '.node-version'
cache: 'pnpm'
- run: corepack enable
- run: pnpm i --frozen-lockfile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corepack enableを戻したいです

Copy link
Contributor

@Mar0xy Mar0xy Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corepack enable is obsolete here cause Install PNPM does the same thing (https://github.com/pnpm/action-setup) which is a few lines above. so either install pnpm step should be removed or corepack enable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'ere currently generally using corepack so I prefer corepack enable and removing duplicate is out of scope of this PR.

Copy link
Contributor

@Mar0xy Mar0xy Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also be done in a seperate PR cause I noticed you tried to already make pnpm use the version specified in package.json with ed74f7b

but it never worked on some of the workflow files cause corepack enable later on overwrote it with the latest version upon running.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it never worked on some of the workflow files cause corepack enable later on overwrote it with the latest version upon running.

corepack won't overwrite with latest version.

Corepack checks for latest version of package manager as a part of startup (of no latest version cache are not exists), to be used as default version when version is not specified.

Regardless which version is latest version recognized by corepack, corepack will use version defined in packageManager field.

- name: Check pnpm-lock.yaml
run: git diff --exit-code pnpm-lock.yaml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
- packages/misskey-js/**
- .github/workflows/test-backend.yml
- .github/misskey/test.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
unit:
name: Unit tests (backend)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-federation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- packages/misskey-js/**
- .github/workflows/test-federation.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
test:
name: Federation test
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
- packages/backend/**
- .github/workflows/test-frontend.yml
- .github/misskey/test.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
vitest:
name: Unit tests (frontend)
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-misskey-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
paths:
- packages/misskey-js/**
- .github/workflows/test-misskey-js.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
test:
name: Unit tests (misskey.js)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
NODE_ENV: production
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
production:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/validate-api-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
paths:
- packages/backend/**
- .github/workflows/validate-api-json.yml

env:
COREPACK_DEFAULT_TO_LATEST: 0

jobs:
validate-api-json:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 2025.2.0

### General
-
- Fix: Docker のビルドに失敗する問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/883)

### Client
- Fix: 一部環境でセンシティブなファイルを含むノートの非表示が効かない問題
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG NODE_VERSION=22.11.0-bookworm

FROM --platform=$BUILDPLATFORM node:${NODE_VERSION} AS native-builder

ENV COREPACK_DEFAULT_TO_LATEST=0

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean \
Expand Down Expand Up @@ -44,6 +46,8 @@ RUN rm -rf .git/

FROM --platform=$TARGETPLATFORM node:${NODE_VERSION} AS target-builder

ENV COREPACK_DEFAULT_TO_LATEST=0

RUN apt-get update \
&& apt-get install -yqq --no-install-recommends \
build-essential
Expand All @@ -68,6 +72,7 @@ FROM --platform=$TARGETPLATFORM node:${NODE_VERSION}-slim AS runner

ARG UID="991"
ARG GID="991"
ENV COREPACK_DEFAULT_TO_LATEST=0

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
Loading