Skip to content

release

release #269

Workflow file for this run

# based on https://github.com/hi-ogawa/unocss-preset-antd/blob/1e096a1e2b8bbf6193bb6f0fb33e225ca355fb6e/.github/workflows/release.yml#L28-L36
# required secrets
# VERCEL_ORG_ID
# VERCEL_PROJECT_ID
# VERCEL_TOKEN
name: release
on:
workflow_dispatch:
inputs:
environment:
required: true
type: choice
options:
- staging
- production
default: production
jobs:
release:
environment:
name: release
url: ${{ steps.release_log.outputs.RELEASE_URL }}
runs-on: ubuntu-latest
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: corepack enable
- run: pnpm i
- run: pnpm build
- run: npm i -g vercel@33.0.1
- run: bash misc/vercel/auth-ci.sh
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
- run: pnpm release --debug | tee release.log
if: inputs.environment == 'staging'
- run: pnpm release-production --debug | tee release.log
if: inputs.environment == 'production'
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
- run: echo "RELEASE_URL=$(tail -n 1 release.log)" >> "$GITHUB_OUTPUT"
id: release_log