Skip to content

Commit

Permalink
move package building to another script
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoly03 committed Dec 5, 2024
1 parent 856ba3b commit 3fe4b66
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 37 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

name: Build Node Package

on:
workflow_call:
# READ MORE https://docs.github.com/en/actions/sharing-automations/reusing-workflows

jobs:
build-node:
runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "21.4.0"
registry-url: "https://registry.npmjs.org"

- name: Install node modules
run: npm ci

- name: Build `.proto` files
run: npm run generate-proto

- name: Build the binary
run: npm run build
16 changes: 2 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,8 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v4"

- uses: actions/setup-node@v4
with:
node-version: "21.4.0"

- name: "Install dependencies"
run: npm install

- name: "Build Protobuf Files"
run: npm run generate-proto

- name: "Build project"
run: npm run build
- name: Build Package
uses: Anatoly03/pixelwalker.js/.github/workflows/build.yml@main

- name: "Building Documentation"
run: npm run docs
Expand Down
19 changes: 2 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,8 @@ jobs:
contents: write
timeout-minutes: 3
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "21.4.0"
registry-url: "https://registry.npmjs.org"

- name: Install node modules
run: npm ci

- name: Build `.proto` files
run: npm run generate-proto

- name: Build the binary
run: npm run build
- name: Build Package
uses: Anatoly03/pixelwalker.js/.github/workflows/build.yml@main

- name: Update version
run: npm version patch
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
# this action is using a secret, would run the action the with "pull_request"
# with base branch.
pull_request_target:
paths:
- "src"
- "test"
# The types trigger are needed to prevent github running our action when a
# pull request is marked as draft:
# https://github.community/t/dont-run-actions-on-draft-pull-requests/16817/16
Expand All @@ -23,9 +26,8 @@ jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: "21.4.0"
- run: npm ci
- run: npm test
- name: Build Package
uses: Anatoly03/pixelwalker.js/.github/workflows/build.yml@main

- name: Run Tests
run: npm test

0 comments on commit 3fe4b66

Please sign in to comment.