Skip to content

fix: simplify CI workflows - remove auto-publish, reduce matrix size #4

fix: simplify CI workflows - remove auto-publish, reduce matrix size

fix: simplify CI workflows - remove auto-publish, reduce matrix size #4

Workflow file for this run

name: Release

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

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 53, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.NPM_TOKEN != ''
on:
workflow_dispatch:
inputs:
version:
description: 'Version bump type (patch, minor, major)'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm test
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version
id: version
run: |
npm version ${{ inputs.version }} -m "release: v%s"
NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Push tag
run: git push origin main --tags
- name: Publish to npm
if: secrets.NPM_TOKEN != ''
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.new_version }}
generate_release_notes: true