Skip to content

Merge branch 'main' of github.com:matthewgallo/generate-pattern #27

Merge branch 'main' of github.com:matthewgallo/generate-pattern

Merge branch 'main' of github.com:matthewgallo/generate-pattern #27

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
dry-run:
required: true
description: 'Run dry run?'
type: boolean
default: true
push:
branches:
- main
jobs:
release:
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Set dry run env variable
run: |
if [ "${{ github.event.inputs.dry-run }}" == "true" ]; then
echo "PUBLISH=--dry-run" >> $GITHUB_ENV
fi
- name: Fresh install
run: yarn install --immutable --immutable-cache --check-cache
- name: Clean dist
run: yarn clean
- name: Build
run: yarn build
- name: Install Semantic Release and plugins
run: yarn global add semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/github @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/npm
- run: npx semantic-release $(echo "${{ env.PUBLISH }}")
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}