Skip to content

Commit

Permalink
ci: add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Jan 25, 2024
1 parent 9569228 commit 4b58040
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish package

on:
push:
tags:
- 'eslint-config-react@v*.*.*'
- 'prettier-config-react@v*.*.*'

permissions:
contents: read
packages: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- id: get-package
run: |
package=$(echo ${{github.ref_name}} | cut -d@ -f)
echo "package=$package" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: pnpm
registry-url: 'https://npm.pkg.github.com'
scope: '@invoke-ai'

- name: Install dependencies
working-directory: 'packages/${{steps.get-package.outputs.package}}'
run: pnpm install --frozen-lockfile

- name: Publish
shell: bash
run: pnpm publish --access public --no-git-checks
working-directory: 'packages/${{steps.get-package.outputs.package}}'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4b58040

Please sign in to comment.