Skip to content

Create a new GitHub release for a package #1152

Create a new GitHub release for a package

Create a new GitHub release for a package #1152

name: Create a new GitHub release for a package
env:
BROWSERSLIST_IGNORE_OLD_DATA: 1
on:
workflow_dispatch:
inputs:
packageName:
required: true
description: 'Name of package being released'
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
create-release:
# Name the Job
name: Create GitHub release
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: PNPM cache via actions/cache@v3
id: pnpm-cache
uses: actions/cache@v3
with:
path: /home/runner/work/design-system/design-system/common/temp/pnpm-store/v3
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: node common/scripts/install-run-rush.js install
- name: Build components
run: node common/scripts/install-run-rush.js build --to create-release-notes
- name: Create release notes
id: release-notes
run: |
node common/scripts/install-run-rush.js create-release-notes --package-name ${{ github.event.inputs.packageName }}
- name: Print latest version info
run: |
echo "${{ steps.release-notes.outputs.latestVersionTag }}"
- name: 'Create Release'
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.DS_RELEASE_PAT }}
with:
body_path: ./RELEASE_NOTES.md
name: ${{ steps.release-notes.outputs.latestVersionTag }}
tag_name: ${{ steps.release-notes.outputs.latestVersionTag }}