chore: v5.0.0 #75
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: 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@v4 | |
- uses: volta-cli/action@v4 | |
- uses: pnpm/action-setup@v4 | |
- 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 |