Publish #15
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 Draft | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
create-release-draft: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org/' | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: '9' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Create compressed packages | |
run: | | |
cd packages | |
for dir in */; do | |
cd "$dir" | |
pnpm pack | |
cd .. | |
done | |
- name: Determine Release Type | |
id: release-type | |
run: | | |
if [[ "${GITHUB_REF}" == *"beta"* ]]; then | |
echo "release=pre-release" >> $GITHUB_ENV | |
else | |
echo "release=latest" >> $GITHUB_ENV | |
fi | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag: ${{ github.ref }} | |
files: | | |
packages/*/*.tgz | |
name: ${{ github.event.repository.name }} ${{ github.ref }} | |
draft: true | |
prerelease: ${{ env.release == 'pre-release' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |