Skip to content

Commit 13577e1

Browse files
authored
chore: switch to pnpm instead of yarn (podman-desktop#8589)
Signed-off-by: Florent Benoit <[email protected]>
1 parent ccbdd9b commit 13577e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+24139
-21623
lines changed

.github/workflows/add-pnpm.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#
2+
# Copyright (C) 2024 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: pnpm-release
19+
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
tag:
24+
description: 'Tag to build the release from'
25+
required: true
26+
27+
env:
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
29+
30+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
31+
jobs:
32+
33+
pnpm-store:
34+
name: pnpm-store-${{ matrix.arch }}
35+
runs-on: ubuntu-24.04
36+
strategy:
37+
matrix:
38+
arch: [amd64, arm64]
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
ref: ${{ github.event.inputs.tag }}
44+
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
47+
- name: create the pnpm store from the dependencies
48+
run: |
49+
podman run --platform linux/${{ matrix.arch }} -v $(pwd):/project --rm -it --entrypoint=sh node:20 -c "cd /project && corepack enable pnpm && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm install --frozen-lockfile --store-dir pnpm-store"
50+
# now the store is in the pnpm-store directory
51+
# create a tarball of the store
52+
echo "Creating the archive store-cache-pnpm-${{ matrix.arch }}.tgz"
53+
tar -czf store-cache-pnpm-${{ matrix.arch }}.tgz pnpm-store
54+
ls -la
55+
56+
- name: Upload binaries to release
57+
uses: svenstaro/upload-release-action@v2
58+
with:
59+
repo_token: ${{ secrets.GITHUB_TOKEN }}
60+
file: store-cache-pnpm-${{ matrix.arch }}.tgz
61+
tag: ${{ github.event.inputs.tag }}

.github/workflows/argos.yaml

+15-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2023 Red Hat, Inc.
2+
# Copyright (C) 2023-2024 Red Hat, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ on:
2424
- main
2525
paths:
2626
- 'package.json'
27-
- 'yarn.lock'
27+
- 'pnpm-lock.yaml'
2828
- 'storybook/**'
2929
- 'website/**'
3030
- 'website-argos/**'
@@ -34,7 +34,7 @@ on:
3434
paths:
3535
- '.github/workflows/argos.yaml'
3636
- 'package.json'
37-
- 'yarn.lock'
37+
- 'pnpm-lock.yaml'
3838
- 'storybook/**'
3939
- 'website/**'
4040
- 'website-argos/**'
@@ -45,38 +45,32 @@ jobs:
4545
runs-on: ubuntu-22.04
4646
steps:
4747
- uses: actions/checkout@v4
48-
- uses: actions/setup-node@v4
48+
- uses: pnpm/action-setup@v4
49+
name: Install pnpm
4950
with:
50-
node-version: 20
51-
52-
- name: Get yarn cache directory path
53-
id: yarn-cache-dir-path
54-
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
51+
run_install: false
5552

56-
- uses: actions/cache@v4
57-
id: yarn-cache
53+
- uses: actions/setup-node@v4
5854
with:
59-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
60-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
61-
restore-keys: |
62-
${{ runner.os }}-yarn-
55+
node-version: 20
56+
cache: 'pnpm'
6357

64-
- name: Execute yarn
65-
run: yarn --frozen-lockfile
58+
- name: Execute pnpm
59+
run: pnpm install
6660

6761
- name: Run website
68-
run: yarn website:build
62+
run: pnpm website:build
6963

7064
- name: Install Playwright browsers
7165
working-directory: website-argos
72-
run: yarn playwright install --with-deps chromium
66+
run: pnpm playwright install --with-deps chromium
7367

7468
- name: Take screenshots with Playwright
75-
run: yarn website:screenshots
69+
run: pnpm website:screenshots
7670

7771
- name: Upload screenshots to Argos
7872
continue-on-error: true
7973
working-directory: website-argos
80-
run: yarn upload
74+
run: pnpm upload
8175
env:
8276
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}

.github/workflows/e2e-main.yaml

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2023 Red Hat, Inc.
2+
# Copyright (C) 2023-2024 Red Hat, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -53,9 +53,18 @@ jobs:
5353
- uses: actions/checkout@v4
5454
if: github.event_name == 'push'
5555

56+
- uses: pnpm/action-setup@v4
57+
name: Install pnpm
58+
with:
59+
run_install: false
60+
5661
- uses: actions/setup-node@v4
5762
with:
5863
node-version: 20
64+
cache: 'pnpm'
65+
66+
- name: Execute pnpm
67+
run: pnpm install
5968

6069
- name: Update podman
6170
run: |
@@ -73,27 +82,15 @@ jobs:
7382
wget https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/amd64/conmon_2.1.2~0_amd64.deb -O /tmp/conmon_2.1.2.deb
7483
sudo apt install /tmp/conmon_2.1.2.deb
7584
76-
- name: Get yarn cache directory path
77-
id: yarn-cache-dir-path
78-
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
79-
80-
- uses: actions/cache@v4
81-
id: yarn-cache
82-
with:
83-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
84-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
85-
restore-keys: |
86-
${{ runner.os }}-yarn-
87-
88-
- name: Execute yarn
89-
run: yarn --frozen-lockfile
85+
- name: Execute pnpm
86+
run: pnpm install
9087

9188
- name: Run All E2E tests
9289
env:
9390
PODMANDESKTOP_CI_BOT_TOKEN: ${{ secrets.PODMANDESKTOP_CI_BOT_TOKEN }}
9491
TEST_PODMAN_MACHINE: 'true'
9592
SKIP_KIND_INSTALL: 'true'
96-
run: yarn test:e2e
93+
run: pnpm test:e2e
9794

9895
- uses: actions/upload-artifact@v4
9996
if: always()

.github/workflows/next-build.yaml

+22-51
Original file line numberDiff line numberDiff line change
@@ -86,50 +86,27 @@ jobs:
8686
- uses: actions/checkout@v4
8787
with:
8888
ref: ${{ needs.tag.outputs.githubTag}}
89+
90+
- uses: pnpm/action-setup@v4
91+
name: Install pnpm
92+
with:
93+
run_install: false
94+
8995
- uses: actions/setup-node@v4
9096
with:
9197
node-version: 20
98+
cache: 'pnpm'
9299

93100
- uses: actions/setup-python@v5
94101
with:
95102
python-version: "3.x"
96103

97-
- name: Get yarn cache directory path (Windows)
98-
if: ${{ matrix.os=='windows-2022' }}
99-
id: yarn-cache-dir-path-windows
100-
run: echo "dir=$(yarn cache dir)" >> ${env:GITHUB_OUTPUT}
101-
102-
- name: Get yarn cache directory path (mac/Linux)
103-
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
104-
id: yarn-cache-dir-path-unix
105-
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
106-
107-
- uses: actions/cache@v4
108-
if: ${{ matrix.os=='windows-2022' }}
109-
id: yarn-cache-windows
110-
with:
111-
path: ${{ steps.yarn-cache-dir-path-windows.outputs.dir }}
112-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
113-
restore-keys: |
114-
${{ runner.os }}-yarn-
115-
116-
- uses: actions/cache@v4
117-
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
118-
id: yarn-cache-unix
119-
with:
120-
path: ${{ steps.yarn-cache-dir-path-unix.outputs.dir }}
121-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
122-
restore-keys: |
123-
${{ runner.os }}-yarn-
124-
125-
126104
- name: setup telemetry key for production
127105
run: |
128106
sed -i -r -e "s/SEGMENT_KEY = '.*'/SEGMENT_KEY = '${{ secrets.SEGMENT_WRITE_KEY }}'/" packages/main/src/plugin/telemetry/telemetry.ts
129107
130-
- name: yarn
131-
run: |
132-
yarn --frozen-lockfile --network-timeout 180000
108+
- name: Execute pnpm
109+
run: pnpm install
133110

134111
- name: Install flatpak on Linux
135112
if: ${{ matrix.os=='ubuntu-24.04' }}
@@ -162,7 +139,7 @@ jobs:
162139
163140
- name: Run Build
164141
timeout-minutes: 40
165-
run: yarn compile:next
142+
run: pnpm compile:next
166143

167144
release:
168145
needs: [tag, build]
@@ -185,24 +162,18 @@ jobs:
185162
runs-on: ubuntu-24.04
186163
steps:
187164
- uses: actions/checkout@v4
188-
- uses: actions/setup-node@v4
165+
- uses: pnpm/action-setup@v4
166+
name: Install pnpm
189167
with:
190-
node-version: 20
168+
run_install: false
191169

192-
- name: Get yarn cache directory path
193-
id: yarn-cache-dir-path
194-
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
195-
196-
- uses: actions/cache@v4
197-
id: yarn-cache
170+
- uses: actions/setup-node@v4
198171
with:
199-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
200-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
201-
restore-keys: |
202-
${{ runner.os }}-yarn-
172+
node-version: 20
173+
cache: 'pnpm'
203174

204-
- name: Execute yarn
205-
run: yarn --frozen-lockfile --network-timeout 180000
175+
- name: Execute pnpm
176+
run: pnpm install
206177

207178
- name: Set-up npmjs auth token
208179
run: printf "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}\n" >> ~/.npmrc
@@ -211,22 +182,22 @@ jobs:
211182
run: |
212183
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
213184
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/extension-api/package.json
214-
cd packages/extension-api && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
185+
cd packages/extension-api && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
215186
216187
- name: Publish Webview API to npmjs
217188
run: |
218189
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
219190
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/webview-api/package.json
220-
cd packages/webview-api && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
191+
cd packages/webview-api && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
221192
222193
- name: Publish ui/svelte to npmjs
223194
run: |
224195
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
225196
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" packages/ui/package.json
226-
cd packages/ui && yarn build && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
197+
cd packages/ui && pnpm build && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
227198
228199
- name: Publish tests-playwright to npmjs
229200
run: |
230201
echo "Using version ${{ needs.tag.outputs.desktopVersion }}"
231202
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ needs.tag.outputs.desktopVersion }}\",#g" tests/playwright/package.json
232-
cd tests/playwright && yarn build && yarn publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public
203+
cd tests/playwright && pnpm build && pnpm publish --tag next --no-git-tag-version --new-version "${{ needs.tag.outputs.desktopVersion }}" --access public

.github/workflows/pr-check-website.yaml

+10-16
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
pull_request:
2222
paths:
2323
- 'package.json'
24-
- 'yarn.lock'
24+
- 'pnpm-lock.yaml'
2525
- 'website/**'
2626
- 'storybook/**'
2727
- 'packages/extension-api/src/**'
@@ -32,27 +32,21 @@ jobs:
3232
runs-on: ubuntu-24.04
3333
steps:
3434
- uses: actions/checkout@v4
35-
- uses: actions/setup-node@v4
35+
- uses: pnpm/action-setup@v4
36+
name: Install pnpm
3637
with:
37-
node-version: 20
38-
39-
- name: Get yarn cache directory path
40-
id: yarn-cache-dir-path
41-
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
38+
run_install: false
4239

43-
- uses: actions/cache@v4
44-
id: yarn-cache
40+
- uses: actions/setup-node@v4
4541
with:
46-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
47-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-yarn-
42+
node-version: 20
43+
cache: 'pnpm'
5044

51-
- name: Execute yarn
52-
run: yarn --frozen-lockfile
45+
- name: Execute pnpm
46+
run: pnpm install
5347

5448
- name: Run website
55-
run: yarn website:build
49+
run: pnpm website:build
5650

5751
- name: Store pull request details for publish-netlify
5852
run: |

0 commit comments

Comments
 (0)