Skip to content

chore(release): 1.15.2 #8

chore(release): 1.15.2

chore(release): 1.15.2 #8

name: Publish Node Runtime Image
on:
workflow_dispatch:
inputs:
tag:
description: "Optional version tag (defaults to package.json version)"
required: false
include_latest:
description: "Also publish :latest"
required: false
default: "true"
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: "1.3.9"
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve image tags
id: tags
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_TAG: ${{ github.event.inputs.tag }}
INPUT_INCLUDE_LATEST: ${{ github.event.inputs.include_latest }}
run: |
set -euo pipefail
if [ -n "${INPUT_TAG}" ]; then
VERSION="${INPUT_TAG#v}"
elif [ "${EVENT_NAME}" = "push" ] && [ "${GITHUB_REF_TYPE}" = "tag" ]; then
VERSION="${GITHUB_REF_NAME#v}"
else
VERSION="$(bun -e "const pkg = await Bun.file('package.json').json(); console.log(pkg.version)")"
fi
if [ -z "${VERSION}" ]; then
echo "Unable to resolve image version."
exit 1
fi
IMAGE="ghcr.io/${{ github.repository_owner }}/hack-node-runtime"
TAG_ARGS="--tag ${IMAGE}:${VERSION}"
if [ "${EVENT_NAME}" = "push" ] || [ "${INPUT_INCLUDE_LATEST}" = "true" ]; then
TAG_ARGS="${TAG_ARGS} --tag ${IMAGE}:latest"
fi
{
echo "version=${VERSION}"
echo "image=${IMAGE}"
echo "tag_args=${TAG_ARGS}"
} >> "$GITHUB_OUTPUT"
- name: Build and push node runtime image
run: |
bun run scripts/build-node-runtime-image.ts \
--push \
--platform linux/amd64,linux/arm64 \
${{ steps.tags.outputs.tag_args }}
- name: Summary
run: |
{
echo "### Node runtime image published"
echo ""
echo "- Image: \`${{ steps.tags.outputs.image }}\`"
echo "- Version: \`${{ steps.tags.outputs.version }}\`"
echo "- Tags: \`${{ steps.tags.outputs.tag_args }}\`"
} >> "$GITHUB_STEP_SUMMARY"