Skip to content

Release

Release #30

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release-type:
type: choice
required: true
description: 'Release type:'
default: 'patch'
options:
- 'patch'
- 'minor'
- 'major'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: 'pnpm'
- name: Install workspace
run: pnpm install
- name: Update version for all packages
run: |
echo "NEW_VERSION=$(pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false)" >> $GITHUB_ENV
cd packages/prez-lib
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd ../prez-components
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd ../prez-ui
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd ../create-prez-app
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd template
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
# prez-lib
- name: Build prez-lib
working-directory: packages/prez-lib
run: pnpm build
- name: Publish prez-lib to NPM
working-directory: packages/prez-lib
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
# prez-components
- name: Build prez-components
working-directory: packages/prez-components
run: pnpm build
- name: Publish prez-components to NPM
working-directory: packages/prez-components
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
# prez-ui layer
- name: Publish prez-ui to NPM
working-directory: packages/prez-ui
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
# create-prez-app
- name: Update prez-ui dependency in template
working-directory: packages/create-prez-app/template
run: pnpm up prez-ui
- name: Publish create-prez-app to NPM
working-directory: packages/create-prez-app
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
- name: Git configuration
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Commit & push changes with tag
run: |
git add -A
git commit -m "chore: release ${{ env.NEW_VERSION }}"
git tag ${{ env.NEW_VERSION }}
git push origin && git push --tags
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.NEW_VERSION }}
generate_release_notes: true