-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.23 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: release
on:
workflow_dispatch:
inputs:
version:
type: string
description: The version to use for the release.
default: ''
dry-run:
type: boolean
default: true
push:
branches:
- 'main'
jobs:
main:
if: "${{ github.event_name == 'workflow_dispatch' || !startsWith(github.event.head_commit.message, 'chore: release') }}"
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git config user.email "[email protected]"
git config user.name "release"
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: 'pnpm'
cache-dependency-path: 'pnpm-lock.yaml'
- run: pnpm i
- run: pnpm exec nx report
- run: pnpm exec nx release --skip-publish --dry-run=${{ env.DRY_RUN }} ${{ env.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ github.event_name == 'push' || inputs.dry-run }}
VERSION: ${{ github.event_name == 'push' && '' || inputs.version }}