This repository has been archived by the owner on Sep 6, 2024. It is now read-only.
Publish Package #7
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' | |
on: | |
workflow_dispatch: | |
inputs: | |
package: | |
type: choice | |
description: Package to Publish | |
options: | |
- core | |
- core-express | |
- core-mongo | |
- core-mongo-express | |
version: | |
type: choice | |
description: Version Increment | |
options: | |
- patch | |
- minor | |
- major | |
- prepatch | |
- preminor | |
- premajor | |
- prerelease | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./packages/${{ github.event.inputs.package }} | |
permissions: | |
contents: write | |
env: | |
COREPACK_ENABLE_STRICT: '0' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'pnpm' | |
registry-url: 'https://registry.npmjs.org' | |
- run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- id: version | |
run: echo "version=$(npm version ${{ github.event.inputs.version }})" >> $GITHUB_OUTPUT | |
- run: git add package.json && git commit -m "publish ${{ github.event.inputs.version }} ${{ steps.version.outputs.version }}" | |
- run: pnpm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: git push |