container/.github/workflows/engine-publish.yml

42 lines
1.7 KiB
YAML

name: Engine - Version and Release
on:
workflow_dispatch:
inputs:
newversion:
description: 'Semantic Version Bump Type (major minor patch)'
default: patch
env:
node_version: 24
defaults:
run:
working-directory: engine
jobs:
version_and_release:
runs-on: ubuntu-latest
permissions:
contents: write # git push --follow-tags
id-token: write # OIDC trusted publishing
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
# registry-url is required so npm publish targets the public npm registry
registry-url: 'https://registry.npmjs.org'
- run: npm install -g pnpm@5.17.1
- run: pnpm install
- run: git config --global user.name github-actions
- run: git config --global user.email bot@github.com
- run: yarn config set version-git-message "Engine v%s"
- run: yarn version --${{ github.event.inputs.newversion }}
- run: sed -i 's:container-engine:@boardgamers/container-engine:' package.json
# pnpm 10.16+ supports OIDC trusted publishing; publish via npx so we don't have to bump
# the repo-wide pnpm. No NODE_AUTH_TOKEN is set, so publishing authenticates with the
# OIDC token instead of the (now-rejected) npm token.
- run: npx -y pnpm@latest publish . --access public --no-git-checks
- run: git push --follow-tags