podman-desktop/.github/workflows/add-pnpm.yaml
Florent BENOIT 13577e14ec
chore: switch to pnpm instead of yarn (#8589)
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
2024-08-29 20:13:01 +00:00

61 lines
2 KiB
YAML

#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: pnpm-release
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build the release from'
required: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
pnpm-store:
name: pnpm-store-${{ matrix.arch }}
runs-on: ubuntu-24.04
strategy:
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: create the pnpm store from the dependencies
run: |
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"
# now the store is in the pnpm-store directory
# create a tarball of the store
echo "Creating the archive store-cache-pnpm-${{ matrix.arch }}.tgz"
tar -czf store-cache-pnpm-${{ matrix.arch }}.tgz pnpm-store
ls -la
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: store-cache-pnpm-${{ matrix.arch }}.tgz
tag: ${{ github.event.inputs.tag }}