Skip to content

0.5.2

0.5.2 #6

Workflow file for this run

name: Publish to npm
# Auto-publishes @codeceptjs/reflection to npm on every GitHub release.
# Mirrors codeceptjs/codeceptjs `.github/workflows/publish-beta.yml` — same
# pattern: setup-node with registry-url, local install, upgrade npm to latest,
# set version from release tag, publish with --provenance via trusted publishing.
#
# Tag the release with a plain SemVer tag like `0.4.0` or `0.5.0-beta.1`
# (no `v` prefix).
# - Stable tags publish under the default `latest` dist-tag.
# - Prereleases (alpha/beta/rc) publish under the `beta` dist-tag.
on:
release:
types: [published]
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish @codeceptjs/reflection (provenance)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm install -g npm@latest
- name: Set package version
run: |
VERSION="${{ github.event.release.tag_name }}"
npm version "$VERSION" --no-git-tag-version
- name: Determine dist-tag
id: disttag
run: |
if [[ "${{ github.event.release.prerelease }}" == "true" ]] \
|| [[ "${{ github.event.release.tag_name }}" == *alpha* ]] \
|| [[ "${{ github.event.release.tag_name }}" == *beta* ]] \
|| [[ "${{ github.event.release.tag_name }}" == *rc* ]]; then
echo "tag=beta" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish to npm
run: npm publish --provenance --access public --tag ${{ steps.disttag.outputs.tag }}