-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (56 loc) · 1.78 KB
/
ci.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 🤹♂️ Continuous Integration
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
name: 🍞 Deploy
runs-on: ubuntu-latest
steps:
- name: 🛫 Checkout Code
uses: actions/checkout@v4
- name: 📦 Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
registry-url: https://registry.npmjs.org/
scope: '@pungrumpy'
- name: 🚀 Setup Bun
uses: oven-sh/setup-bun@v1
- name: 🔽 Install Dependencies
run: bun install
- name: ⚖️ Lint
run: bun lint
- name: 🧑🍳 Check version exists
run: |
VERSION_EXISTS=$(npm show logixlysia version 2>/dev/null || echo "false")
if [ "$VERSION_EXISTS" != "false" ]; then
echo "Logixlysia version $VERSION_EXISTS already exists"
exit 1
fi
shell: bash
- name: 🧑🍳 Check version is valid
run: |
VERSION=$(node -p "require('./package.json').version")
if [ "$VERSION" == "" ]; then
echo "Version is empty"
exit 1
fi
shell: bash
- name: 🛰️ Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: 💂 Error
if: failure() || cancelled()
run: |
echo "${{ github.event_name }} failed on branch ${{ github.ref }} at commit ${{ github.sha }}"
echo "See ${{ github.run_number }} for more details"
- name: 🎉 Success
if: success()
run: |
echo "${{ github.event_name }} succeeded on branch ${{ github.ref }} at commit ${{ github.sha }}"
echo "See ${{ github.run_number }} for more details"