-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (38 loc) · 1.26 KB
/
npm.yml
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
name: 📦 Node Package Manager
on:
workflow_run:
workflows: ['🧝 Continuous Delivery']
types: [completed]
branches: [main]
jobs:
test_version:
name: 🧪 Test Version
runs-on: ubuntu-latest
steps:
- name: 🛬 Checkout
uses: actions/checkout@v4
- name: 🟢 Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
registry-url: https://registry.npmjs.org/
- name: 🔽 Install Dependencies
run: npm install
- name: 🦊 Install Logixlysia
run: npm install logixlysia
- name: 🔖 Check version
id: check_version
run: |
touch .version
ACTUAL_VERSION=$(npm view logixlysia version)
EXPECTED_VERSION=$(node -p "require('./package.json').version")
echo "Actual version: $ACTUAL_VERSION" >> .version
echo "Expected version: $EXPECTED_VERSION" >> .version
if [ "$ACTUAL_VERSION" != "$EXPECTED_VERSION" ]; then
echo "Version mismatch: expected $EXPECTED_VERSION, got $ACTUAL_VERSION"
echo "status=mismatch" >> $GITHUB_OUTPUT
exit 1
fi
echo "status=match" >> $GITHUB_OUTPUT
outputs:
status: ${{ steps.check_version.outputs.status }}