Skip to content

Commit c6155e0

Browse files
committed
ci: use shared setup-workspace action for workflows
1 parent 9d5248a commit c6155e0

6 files changed

Lines changed: 20 additions & 26 deletions

File tree

.github/actions/setup-node/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ runs:
1818
cache: npm
1919
cache-dependency-path: ${{ inputs.cache-dependency-path }}
2020
node-version: ${{ inputs.node-version }}
21+
registry-url: https://registry.npmjs.org/

.github/actions/setup-workspace/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ runs:
2929

3030
- name: Install and build 🔧
3131
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
32-
run: npm ci --ignore-scripts --prefer-offline
32+
run: |
33+
npm ci --ignore-scripts --prefer-offline
34+
npm run postbuild
3335
shell: bash

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ jobs:
109109
os: ubuntu-latest
110110
node-version: 22
111111

112-
- name: Build 🔧
113-
run: npm run build
114-
115112
- name: Collect coverage 🧪
116113
run: npm run test -- --coverage
117114
env:

.github/workflows/prepare-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout 🛎️
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
2424
with:
2525
fetch-depth: 20
2626
fetch-tags: false

.github/workflows/release-and-publish.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,13 @@ jobs:
4040
permissions:
4141
contents: write # for actions/create-release to create a release
4242
needs: [setup_variables]
43-
# The type of runner that the job will run on
4443
runs-on: ubuntu-latest
4544

46-
# Steps represent a sequence of tasks that will be executed as part of the
47-
# job
4845
steps:
49-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access
50-
# it
51-
- name: Checkout code
52-
# https://github.com/marketplace/actions/checkout
46+
- name: Checkout 🛎️
5347
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
48+
with:
49+
fetch-tags: false
5450

5551
# Runs a single command using the runners shell
5652
- name: Create release for tag
@@ -70,23 +66,24 @@ jobs:
7066
runs-on: ubuntu-latest
7167

7268
steps:
73-
# https://github.com/marketplace/actions/checkout
74-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
75-
# https://github.com/marketplace/actions/setup-node-js-environment
76-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
69+
- name: Checkout 🛎️
70+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
71+
with:
72+
fetch-tags: false
73+
74+
- name: Setup workspace ⚙️
75+
uses: ./.github/actions/setup-workspace
7776
with:
78-
node-version: 22.20.0
79-
registry-url: https://registry.npmjs.org/
80-
- name: Check lock file
81-
# runs npm install using package-lock.json and verifies
82-
# if dependencies are matching with package.json or not
83-
run: npm ci --ignore-scripts
77+
os: ubuntu-latest
78+
node-version: 22
79+
8480
# This will tell npm to publish your scoped package with public access
8581
- name: Publish with latest tag
8682
if: ${{ needs.setup_variables.outputs.isLatest == 'true' }}
8783
run: npm publish --access public
8884
env:
8985
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
86+
9087
- name: Publish with next tag
9188
if: ${{ needs.setup_variables.outputs.isLatest != 'true' }}
9289
run: npm publish --access public --tag next

.github/workflows/test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: Checkout 🛎️
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
2727
with:
2828
fetch-depth: 20
2929
fetch-tags: false
@@ -34,9 +34,6 @@ jobs:
3434
os: ${{ inputs.os }}
3535
node-version: ${{ inputs.node-version }}
3636

37-
- name: Build 🔧
38-
run: npm run build
39-
4037
- name: Run tests 🧪
4138
run: npm run test
4239
env:

0 commit comments

Comments
 (0)