Skip to content

Print

Print #6

Workflow file for this run

name: Publish Package

Check failure on line 1 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

(Line: 26, Col: 16): Unrecognized named-value: 'github'. Located at position 8 within expression: tojson(github.ref), (Line: 29, Col: 16): Unrecognized named-value: 'github'. Located at position 8 within expression: tojson(github.head_ref)
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
id-token: write # Required for OIDC
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ${{ tojson(github.event) }}
shell: cat {0}
- run: test
shell: echo ${{ tojson(github.ref) }}
- run: test 2
shell: echo ${{ tojson(github.head_ref) }}
- name: Setup npm
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Cache dependencies
id: deps-cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-deps-${{ hashFiles('./bun.lock') }}
- name: Install dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: bun ci
- name: Run tests
run: bun test
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update package.json version
run: npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version
- name: Commit version update
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore: bump version to ${{ steps.get_version.outputs.VERSION }}"
git push origin HEAD:main
- name: Build
run: bun run build
# - name: Publish
# run: npm publish --provenance