Skip to content

Commit

Permalink
chore: publish to npm on workflow dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
yathomasi committed Apr 27, 2023
1 parent ead5fdd commit 0d813d6
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
name: Publish Package to npmjs
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
type: choice
description: 'Version to publish'
required: true
options: ['patch', 'minor', 'major', 'pre']
default: 'patch'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
scope: '@dvcorg'
cache: 'yarn'

- name: Install dependencies
run: |
yarn install --frozen-lockfile
- run: |
yarn release:ci ${{ github.event.inputs.version }}
cd ./packages/gatsby-theme-iterative
yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0d813d6

Please sign in to comment.