Skip to content

fix: prepare player 0.1.44 (#34) #49

fix: prepare player 0.1.44 (#34)

fix: prepare player 0.1.44 (#34) #49

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "npm-v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
release_tag:
description: Existing SemVer release tag
required: true
type: string
registry:
description: Registry publish job to retry
required: true
type: choice
options:
- npm
- jsr
- both
permissions:
contents: read
jobs:
publish-npm:
if: github.event_name == 'push' || inputs.registry == 'npm' || inputs.registry == 'both'
runs-on: ubuntu-latest
timeout-minutes: 15
environment: npm
permissions:
contents: read
id-token: write
attestations: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
ref: ${{ inputs.release_tag || github.ref }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: 1.3.14
- uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed
with:
deno-version: 2.9.2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: 24.18.0
registry-url: https://registry.npmjs.org
- run: npm install --global npm@12.0.1
- run: bun install --frozen-lockfile
- run: bun audit --audit-level=high
- run: bun run check
- run: bun run check:versions
- run: bun run check:docs
- run: bun run test:coverage
- run: bun run build
- run: node --input-type=module --eval 'const mod = await import("./dist/index.js"); if (typeof mod.TypeTypeMsePlayer !== "function") process.exit(1)'
- name: Verify release version
env:
RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }}
run: |
git show-ref --verify --quiet "refs/tags/$RELEASE_TAG"
test "v$(node --print "require('./package.json').version")" = "${RELEASE_TAG#npm-}"
- name: Check npm version
id: npm-version
run: |
version=$(node --print "require('./package.json').version")
if npm view "@typetype/mse@$version" version >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Pack release
id: pack
run: |
filename=$(npm pack --json --ignore-scripts | jq --raw-output 'if type == "array" then .[0].filename else to_entries[0].value.filename end')
test -n "$filename"
echo "filename=$filename" >> "$GITHUB_OUTPUT"
- uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6
with:
subject-path: ${{ steps.pack.outputs.filename }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: npm-package
path: ${{ steps.pack.outputs.filename }}
if-no-files-found: error
retention-days: 30
- if: steps.npm-version.outputs.exists != 'true'
run: npm publish "${{ steps.pack.outputs.filename }}" --access public --provenance
publish-jsr:
if: (github.event_name == 'push' && startsWith(github.ref_name, 'v')) || inputs.registry == 'jsr' || inputs.registry == 'both'
runs-on: [self-hosted, Linux, X64, arko, typetype]
timeout-minutes: 15
environment: jsr
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
ref: ${{ inputs.release_tag || github.ref }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: 1.3.14
- uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed
with:
deno-version: 2.9.2
- run: bun install --frozen-lockfile
- run: bun audit --audit-level=high
- run: bun run check
- run: bun run check:versions
- run: bun run check:docs
- run: bun run test:coverage
- name: Verify release version
env:
RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }}
run: |
git show-ref --verify --quiet "refs/tags/$RELEASE_TAG"
test "v$(node --print "require('./jsr.json').version")" = "${RELEASE_TAG#npm-}"
- run: bun run publish:jsr