Skip to content

chore: v4.0.6

chore: v4.0.6 #74

Workflow file for this run

name: Publish Package + Create Release
on:
push:
tags:
- 'v*'
- 'create-monkey*'
jobs:
publish_release:
# prevents this action from running on forks
if: github.repository == 'lisonge/vite-plugin-monkey'
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v3
- uses: pnpm/action-setup@v2
- run: pnpm install
- run: pnpm build
- name: Publish package
run: |
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
pnpm run ci-publish ${{ github.ref_name }}
- name: Get pkgName for tag
id: tag
run: |
# matching v2.0.0 / v2.0.0-beta.8 etc
if [[ $GITHUB_REF_NAME =~ ^v.+ ]]; then
pkgName="vite-plugin-monkey"
else
# `%@*` truncates @ and version number from the right side.
# https://stackoverflow.com/questions/9532654/expression-after-last-specific-character
pkgName=${GITHUB_REF_NAME%@*}
fi
echo "::set-output name=pkgName::$pkgName"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: ./packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md