-
Notifications
You must be signed in to change notification settings - Fork 6
50 lines (48 loc) · 1.75 KB
/
Copy pathbuild.yml
File metadata and controls
50 lines (48 loc) · 1.75 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
name: Build
on:
push:
branches:
- master
- release/*/*
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
# We build all ahead of time before linting as we need the build
# step for TS type definitions to be usable. These are used during both
# linting and testing.
# Even more, we need to build the two specific ones first as their type
# definitions are required for the other project builds.
- name: Build prerequisites first
run: |
pnpm --filter @formsort/constants run build
pnpm --filter @formsort/embed-messaging-manager run build
pnpm --filter @formsort/web-embed-api run build
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Pack
run: |
# WARN: This grep pattern relies on the `releaseBranchPrefix` field in .craft.yml files
release_package=$(echo '${{ github.ref_name }}' | grep -Po '(?<=release/)[^/]+(?=/[0-9a-z_.]+)' || [[ $? == 1 ]])
if [[ -n "$release_package" ]]; then
pnpm --filter "@formsort/$release_package" run pack;
else
pnpm -r run pack;
fi
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
if-no-files-found: error
# Match only the .tgz produced in each package's own root.
# The broader `packages/**/*.tgz` pattern follows pnpm's node_modules
# symlinks into sibling workspace packages, bundling stray copies.
path: ${{ github.workspace }}/packages/*/*.tgz