Test #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- uses: dcarbone/[email protected] | |
- uses: actions4git/setup-git@v1 | |
- name: Extract and update version | |
id: trim | |
run: | | |
UNO_VERSION=$(jq .devDependencies.unocss package.json -r) | |
TRIM_VERSION=${UNO_VERSION#^} | |
echo "value=$TRIM_VERSION" >> "$GITHUB_OUTPUT" | |
tmp=$(mktemp) | |
jq --arg a "$TRIM_VERSION" '.version = "$a"' package.json > "$tmp" && mv "$tmp" package.json | |
git add package.json | |
git tag --force 'v$TRIM_VERSION' | |
git commit --message 'v$TRIM_VERSION' | |
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 |