Create Release #9
This file contains 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: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
prerelease: | |
type: boolean | |
description: Mark as pre-release? | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://npm.pkg.github.com/ | |
- name: Conventional Changelog Action | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
release-count: 50 | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
uses: actions/create-release@v1 | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
prerelease: ${{ github.event.inputs.prerelease }} | |
tag_name: ${{ steps.changelog.outputs.tag }} | |
release_name: ${{ steps.changelog.outputs.tag }} | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
- name: Install dependencies | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
run: yarn | |
env: | |
# This is needed because we need to install the linting packages | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Authenticate with the GitHub Package Registry | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" >> | |
~/.npmrc | |
- name: Github publish package | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
registry: "https://npm.pkg.github.com" |