-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (76 loc) · 2.35 KB
/
release.yml
File metadata and controls
89 lines (76 loc) · 2.35 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
name: Package Release
on:
push:
branches:
- latest-release
- beta
permissions:
contents: write
issues: write
pull-requests: write
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
builder_changed: ${{ steps.filter.outputs.builder }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for changeset detection
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
builder:
- 'packages/builder/**'
# Add more packages here as repo grows
# package2:
# - 'packages/package2/**'
release-builder:
needs: detect-changes
if: needs.detect-changes.outputs.builder_changed == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/builder
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for semantic release to work correctly
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: "10.8.1"
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: pnpm build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm semantic-release
# Add more jobs for additional packages as repo grows
# release-package2:
# needs: detect-changes
# if: needs.detect-changes.outputs.package2_changed == 'true'
# ... (similar setup to release-builder)