Files
pnpm/.github/workflows/docker.yml
dependabot[bot] 8cec791e38 chore(deps): bump the github-actions group across 1 directory with 4 updates (#12356)
Bumps the github-actions group with 4 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action), [taiki-e/install-action](https://github.com/taiki-e/install-action) and [crate-ci/typos](https://github.com/crate-ci/typos).


Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](de0fac2e45...df4cb1c069)

Updates `github/codeql-action` from 4.36.0 to 4.36.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7211b7c807...8aad20d150)

Updates `taiki-e/install-action` from 2.79.14 to 2.81.8
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](873c7452ca...0631aa6515)

Updates `crate-ci/typos` from 1.47.0 to 1.47.2
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](f8a58b6b53...37bb98842b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: crate-ci/typos
  dependency-version: 1.47.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 4.36.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.81.6
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-16 15:17:49 +02:00

114 lines
3.7 KiB
YAML

name: Docker
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "pnpm version to build (without leading v)"
required: true
prerelease:
description: "Treat as prerelease (skips mutable tags)"
type: boolean
default: false
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
env:
IMAGE: ghcr.io/${{ github.repository_owner }}/pnpm
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Resolve release metadata
id: meta
env:
EVENT_NAME: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_PRERELEASE: ${{ github.event.release.prerelease }}
INPUT_VERSION: ${{ inputs.version }}
INPUT_PRERELEASE: ${{ inputs.prerelease }}
run: |
set -eu
if [ "$EVENT_NAME" = "release" ]; then
version="${RELEASE_TAG#v}"
prerelease="$RELEASE_PRERELEASE"
else
version="${INPUT_VERSION#v}"
prerelease="$INPUT_PRERELEASE"
fi
case "$version" in
*[!0-9A-Za-z.+-]*) echo "invalid version: $version" >&2; exit 1 ;;
[0-9]*.[0-9]*.[0-9]*) ;;
*) echo "invalid version: $version" >&2; exit 1 ;;
esac
major="${version%%.*}"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "major=$major" >> "$GITHUB_OUTPUT"
echo "prerelease=$prerelease" >> "$GITHUB_OUTPUT"
- name: Compute image tags
id: tags
env:
VERSION: ${{ steps.meta.outputs.version }}
MAJOR: ${{ steps.meta.outputs.major }}
PRERELEASE: ${{ steps.meta.outputs.prerelease }}
run: |
set -eu
tags="${IMAGE}:${VERSION}"
if [ "$PRERELEASE" != "true" ]; then
tags="${tags},${IMAGE}:${MAJOR},${IMAGE}:latest"
fi
echo "tags=$tags" >> "$GITHUB_OUTPUT"
- name: Compute pnpm tarball checksums
id: checksums
env:
VERSION: ${{ steps.meta.outputs.version }}
run: |
set -eu
base="https://github.com/pnpm/pnpm/releases/download/v${VERSION}"
for pair in amd64:x64 arm64:arm64; do
key="${pair%:*}"
name="${pair#*:}"
sha="$(curl -fsSL --retry 3 --retry-delay 2 "${base}/pnpm-linux-${name}.tar.gz" \
| sha256sum | awk '{print $1}')"
echo "sha_${key}=${sha}" >> "$GITHUB_OUTPUT"
done
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Login to GHCR
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: ./docker
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.tags.outputs.tags }}
build-args: |
PNPM_VERSION=${{ steps.meta.outputs.version }}
PNPM_SHA256_AMD64=${{ steps.checksums.outputs.sha_amd64 }}
PNPM_SHA256_ARM64=${{ steps.checksums.outputs.sha_arm64 }}
provenance: mode=max
sbom: true