Skip to content

Commit ed8230b

Browse files
authored
ci: add build+publish workflow (#4761)
add new build reusable workflow. publishes packages via pkg.pr.new Co-authored-by: Bruno Henriques <[email protected]>
1 parent eab0c37 commit ed8230b

File tree

3 files changed

+54
-12
lines changed

3 files changed

+54
-12
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build-all:
7+
type: boolean
8+
description: "Build all packages"
9+
default: true
10+
publish-packages:
11+
type: boolean
12+
description: "Publish all packages"
13+
default: false
14+
workflow_call:
15+
inputs:
16+
build-all:
17+
type: boolean
18+
description: "Build all packages"
19+
default: true
20+
publish-packages:
21+
type: boolean
22+
description: "Publish all packages"
23+
default: false
24+
25+
jobs:
26+
Build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install Dependencies
33+
uses: ./.github/actions/install-dependencies
34+
35+
- name: Build App
36+
run: npm run build -w apps/app
37+
38+
- name: Build Packages
39+
run: npm run build -w packages/ -w apps/default-app
40+
if: ${{ inputs.build-packages || inputs.publish-packages }}
41+
42+
- name: Publish Packages
43+
if: ${{ inputs.publish-packages }}
44+
run: npx -y pkg-pr-new publish './packages/*' --no-template

.github/workflows/nightly.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ jobs:
2020
uses: ./.github/workflows/tests-visual.yml
2121
secrets: inherit
2222

23+
build:
24+
name: Build
25+
uses: ./.github/workflows/build.yml
26+
with:
27+
build-all: true
28+
2329
notify-fail:
2430
name: Notify Fail
25-
needs: [tests, visual-tests]
31+
needs: [tests, build, visual-tests]
2632
if: failure()
2733
runs-on: ubuntu-latest
2834

.github/workflows/tests.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ jobs:
113113
114114
build:
115115
name: Build
116-
runs-on: ubuntu-latest
117-
118-
steps:
119-
- name: Checkout
120-
uses: actions/checkout@v4
121-
122-
- name: Install Dependencies
123-
uses: ./.github/actions/install-dependencies
124-
125-
- name: Run Build
126-
run: npm run build:app
116+
uses: ./.github/workflows/build.yml
117+
with:
118+
build-all: false

0 commit comments

Comments
 (0)