Skip to content

fix(docs): ship up markdown files that contain components (#4776) #92

fix(docs): ship up markdown files that contain components (#4776)

fix(docs): ship up markdown files that contain components (#4776) #92

name: Release CLI
on:
push:
branches:
- main
paths:
- "packages/cli/cli/versions.yml"
# Add this permissions block
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
release-cli:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 2
- name: Install
uses: ./.github/actions/install
- name: Get version from file
id: get_version
run: |
git show HEAD~1:packages/cli/cli/versions.yml > tmp_cli_previous_versions.yml
pnpm seed:local latest cli -o "version.txt" --changelog packages/cli/cli/versions.yml --previous-changelog tmp_cli_previous_versions.yml
if [ ! -f version.txt ]; then
echo "File not found! Skipping release."
echo "HAS_NEW_VERSION=false" >> $GITHUB_OUTPUT
else
echo "HAS_NEW_VERSION=true" >> $GITHUB_OUTPUT
echo "VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
fi
- name: Determine if prerelease
id: check_prerelease
if: steps.get_version.outputs.HAS_NEW_VERSION
run: |
if [[ "${{ steps.get_version.outputs.VERSION }}" == *"rc"* ]]; then
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
else
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: actions/create-release@v1
if: steps.get_version.outputs.HAS_NEW_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: ${{ steps.check_prerelease.outputs.IS_PRERELEASE }}
- name: Display Release URL
if: steps.get_version.outputs.HAS_NEW_VERSION
run: echo "Release created at ${{ steps.create_release.outputs.html_url }}"