Skip to content

Update package.json

Update package.json #8

Workflow file for this run

name: Create Release
on:
pull_request:
branches: [ main ]
types: [ closed ]
permissions:
contents: write
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: 'jq .devDependencies.unocss package.json -r'
- name: Trim version
id: trim
env:
VERSION: ${{ steps.version.outputs.value }}
run: echo "value=${VERSION#^}" >> "$GITHUB_OUTPUT"
- name: Update package version in package.json
uses: sergeysova/jq-action@v2
id: update
with:
cmd: jq '.version = "${{ steps.trim.outputs.value }}"' package.json
- uses: actions4git/setup-git@v1
- run: |
git add package.json
git tag --force v${{ steps.trim.outputs.value }}
git commit --message 'v${{ steps.trim.outputs.value }}'
git push origin main --force
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.trim.outputs.value }}
release_name: Release v${{ steps.trim.outputs.value }}
body: |
Changes in this Release
- Unocss bumped to ${{ steps.trim.outputs.value }}
draft: false
prerelease: false