Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Release & Publish to NPM #12

Release & Publish to NPM

Release & Publish to NPM #12

Workflow file for this run

name: Release & Publish to NPM
on:
workflow_dispatch:
inputs:
increment:
type: choice
description: 'Version type'
required: true
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GRAVATAR_A8C_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Initialize Git user
run: |
git config user.name "gravatar-automattic"
git config user.email "gravatar@automattic.com"
- name: Initialize the NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
run: yarn release ${{ github.event.inputs.increment }} --ci
env:
GITHUB_TOKEN: ${{ secrets.GRAVATAR_A8C_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}