Skip to content

Commit 5a25673

Browse files
committed
update actions
1 parent 32d15dd commit 5a25673

File tree

4 files changed

+116
-3
lines changed

4 files changed

+116
-3
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: build
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
BOT_APP_ID:
7+
description: 'The GitHub App ID for authenticating with the GitHub API'
8+
required: true
9+
BOT_PRIVATE_KEY:
10+
description: 'The GitHub App Private Key for authenticating with the GitHub API'
11+
required: true
12+
outputs:
13+
artifact:
14+
description: "Artifact URL of the build"
15+
value: ${{ jobs.build.outputs.artifact }}
16+
17+
jobs:
18+
build:
19+
if: github.repository_owner == 'bombshell-dev'
20+
runs-on: ubuntu-latest
21+
outputs:
22+
artifact: ${{ steps.upload.outputs.artifact-url }}
23+
24+
steps:
25+
- name: Generate a token
26+
id: bot-token
27+
uses: actions/create-github-app-token@v1
28+
with:
29+
app-id: ${{ secrets.BOT_APP_ID }}
30+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
31+
32+
- uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.head_ref }}
35+
token: ${{ steps.bot-token.outputs.token }}
36+
37+
- name: Setup PNPM
38+
uses: pnpm/action-setup@v4
39+
40+
- name: Setup Node
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
registry-url: https://registry.npmjs.org/
45+
cache: "pnpm"
46+
47+
- name: Install dependencies
48+
run: pnpm install
49+
50+
- name: Build
51+
run: pnpm run build
52+
53+
- uses: actions/upload-artifact@v4
54+
id: upload
55+
with:
56+
name: build
57+
path: dist

.github/workflows/format.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ jobs:
4646
run: pnpm install
4747

4848
- name: Format code
49-
run: pnpm run ${{ inputs.command }}
49+
run: pnpm run "${{env.COMMAND}}"
50+
env:
51+
COMMAND: ${{ inputs.command }}
5052

5153
- name: Commit changes
5254
uses: stefanzweifel/git-auto-commit-action@v5

.github/workflows/preview.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ jobs:
4444
- name: Setup Node
4545
uses: actions/setup-node@v4
4646
with:
47-
node-version: 22
47+
node-version: 20
4848
registry-url: https://registry.npmjs.org/
4949
cache: "pnpm"
5050

5151
- name: Install dependencies
5252
run: pnpm install
5353

54-
- name: Format code
54+
- name: Build packages
55+
run: pnpm run build
56+
57+
- name: Publish Preview
5558
run: pnpx pkg-pr-new publish '${{inputs.publish}}' --template '${{inputs.template}}'

.github/workflows/run.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: build
2+
on:
3+
workflow_call:
4+
inputs:
5+
command:
6+
type: 'string'
7+
description: 'The name of the package.json script to run'
8+
required: true
9+
secrets:
10+
BOT_APP_ID:
11+
description: 'The GitHub App ID for authenticating with the GitHub API'
12+
required: true
13+
BOT_PRIVATE_KEY:
14+
description: 'The GitHub App Private Key for authenticating with the GitHub API'
15+
required: true
16+
17+
jobs:
18+
build:
19+
if: github.repository_owner == 'bombshell-dev'
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Generate a token
24+
id: bot-token
25+
uses: actions/create-github-app-token@v1
26+
with:
27+
app-id: ${{ secrets.BOT_APP_ID }}
28+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
29+
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.head_ref }}
33+
token: ${{ steps.bot-token.outputs.token }}
34+
35+
- name: Setup PNPM
36+
uses: pnpm/action-setup@v4
37+
38+
- name: Setup Node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
registry-url: https://registry.npmjs.org/
43+
cache: "pnpm"
44+
45+
- name: Install dependencies
46+
run: pnpm install
47+
48+
- name: Build
49+
run: pnpm run "${{env.COMMAND}}"
50+
env:
51+
COMMAND: ${{ inputs.command }}

0 commit comments

Comments
 (0)