This repository was archived by the owner on Mar 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 2.89 KB
/
release-check.yml
File metadata and controls
98 lines (85 loc) · 2.89 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release type (major|minor|patch|premajor|preminor|prepatch|prerelease)'
required: true
default: patch
type: choice
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
- prerelease
prerelease_id:
description: 'Prerelease identifier (alpha|beta|rc) - only for prerelease versions'
required: false
default: beta
type: choice
options:
- alpha
- beta
- rc
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: pnpm
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps
- name: Run tests with coverage
run: pnpm coverage
- name: Build package
run: pnpm build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
flags: unittests
fail_ci_if_error: true
- name: Setup Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://${{ secrets.GH_TOKEN }}@github.com/hezhengxu2018/silver-formily-element-plus.git
- name: Version and Release (Regular)
if: ${{ !contains(github.event.inputs.version, 'pre') }}
run: |
pnpm release-it ${{ github.event.inputs.version }} --ci
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Version and Release (Prerelease)
if: ${{ contains(github.event.inputs.version, 'pre') }}
run: |
pnpm release-it ${{ github.event.inputs.version }} --preReleaseId=${{ github.event.inputs.prerelease_id }} --config .release-it.prerelease.json --ci
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}