Skip to content

πŸš€ Release

πŸš€ Release #40

Workflow file for this run

# This workflow will release the packages.
name: πŸš€ Release
on:
workflow_dispatch:
inputs:
version:
type: choice
description: Choose which version to bump before release
default: 'Auto'
options:
- Auto
- Major
- Minor
- Patch
preRelease:
description: |
The pre-release identifier for the version.
For example, if the version is "1.2.3-beta.1", the pre-release identifier is "beta.1".
default: ""
type: string
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
GH_TOKEN: ${{ secrets.UI_BOT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
release:
name: πŸ“¦ Release
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [lts/*]
steps:
- name: ⬇️ Checkout
id: checkout
uses: actions/[email protected]
with:
fetch-depth: 0
token: ${{ env.GH_TOKEN }}
- name: 🟒 Setup node
id: setup-node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: πŸ₯‘ Setup pnpm
id: setup-pnpm
uses: pnpm/[email protected]
with:
version: latest
run_install: false
- name: 🎈 Get pnpm store directory
id: get-pnpm-cache-dir
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: 🧩 Install Dependencies
id: install-dependencies
run: pnpm install
- name: πŸ—οΈ Build
id: build
run: pnpm build
- name: πŸ“’ Release & Publish
id: release-and-publish
run: |
git config user.name "wso2-ui-bot"
git config user.email "[email protected]"
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" >> ~/.npmrc
if [ "${{ github.event.inputs.version }}" = "Major" ]; then
if [ -n "${{ github.event.inputs.preRelease }}" ]; then
npm run release -- major --preRelease="${{ github.event.inputs.preRelease }}" --ci
else
npm run release -- major --ci
fi
elif [ "${{ github.event.inputs.version }}" = "Minor" ]; then
if [ -n "${{ github.event.inputs.preRelease }}" ]; then
npm run release -- minor --preRelease="${{ github.event.inputs.preRelease }}" --ci
else
npm run release -- minor --ci
fi
elif [ "${{ github.event.inputs.version }}" = "Patch" ]; then
if [ -n "${{ github.event.inputs.preRelease }}" ]; then
npm run release -- patch --preRelease="${{ github.event.inputs.preRelease }}" --ci
else
npm run release -- patch --ci
fi
else
if [ -n "${{ github.event.inputs.preRelease }}" ]; then
npm run release -- --preRelease="${{ github.event.inputs.preRelease }}" --ci
else
npm run release -- --ci
fi
fi
env:
NPM_TOKEN: ${{ env.NPM_TOKEN }}
GITHUB_TOKEN: ${{ env.GH_TOKEN }}