v0.0.12 #13
Workflow file for this run
This file contains hidden or 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 To Github | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to publish (patch, minor, major, or specific version)' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
- custom | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@devbyray' | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v3 | |
with: | |
version: '10.6.3' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build packages | |
run: pnpm build | |
- name: Configure Git | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Version packages | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
if [ "${{ github.event.inputs.version }}" == "custom" ]; then | |
echo "Please specify the custom version in the next workflow run." | |
exit 1 | |
else | |
pnpm -r exec -- npm version ${{ github.event.inputs.version }} --no-git-tag-version | |
fi | |
- name: Publish each package separately | |
run: | | |
pnpm -r --filter "@devbyray/vue-wc-components" publish --access public --no-git-checks | |
pnpm -r --filter "@devbyray/vue-wc-button" publish --access public --no-git-checks | |
pnpm -r --filter "@devbyray/vue-wc-icon" publish --access public --no-git-checks | |
pnpm -r --filter "@devbyray/vue-wc-input" publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |