-
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (62 loc) · 1.9 KB
/
release.yaml
File metadata and controls
71 lines (62 loc) · 1.9 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
name: Release
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
- name: "@nicepkg/vsync"
dir: "cli"
copyReadme: "true"
# add new packages here
# - name: "@nicepkg/vsync-core"
# dir: "core"
# copyReadme: "false"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm
- name: Check package exists
id: package-check
shell: bash
run: |
if [ -f "${{ matrix.package.dir }}/package.json" ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Copy README files into package
if: steps.package-check.outputs.exists == 'true' && matrix.package.copyReadme == 'true'
shell: bash
run: |
cp README.md "${{ matrix.package.dir }}/README.md"
cp README_cn.md "${{ matrix.package.dir }}/README_cn.md"
- name: Build package
if: steps.package-check.outputs.exists == 'true'
run: pnpm --filter ${{ matrix.package.name }} build
- name: Run semantic-release
if: steps.package-check.outputs.exists == 'true'
run: pnpm run release
env:
SEMREL_PKG_ROOT: ${{ matrix.package.dir }}
SEMREL_PKG_NAME: ${{ matrix.package.name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
HUSKY: 0