-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (86 loc) · 3.07 KB
/
release.yml
File metadata and controls
102 lines (86 loc) · 3.07 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating releases and uploading assets
packages: write # Required if publishing packages
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run quality checks
run: pnpm run quality
- name: Run tests
run: pnpm test -- --run
- name: Build extension
run: pnpm run build
- name: Create release archive
run: |
mkdir -p release
cp index.js release/
cp package.json release/
cp README.md release/ 2>/dev/null || echo "No README.md found"
cd release
tar -czf ../super-layout-table-${{ github.ref_name }}.tar.gz *
cd ..
- name: Check if release exists
id: check_release
run: |
if gh release view ${{ github.ref_name }} &>/dev/null; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Release already exists, will upload assets only"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Release does not exist, will create it"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release (if not exists)
if: steps.check_release.outputs.exists == 'false'
uses: softprops/action-gh-release@v1
with:
files: super-layout-table-${{ github.ref_name }}.tar.gz
generate_release_notes: true
body: |
## Super Layout Table Extension for Directus
### Installation
1. Download the release archive
2. Extract to your Directus extensions folder
3. Restart Directus
### Quality Checks
- ✅ TypeScript: No errors
- ✅ ESLint: No errors or warnings
- ✅ Prettier: Properly formatted
- ✅ Tests: 39 tests passed (100%)
- ✅ Build: Successful
### Test Coverage
- 🧬 Translation/Language Detection: 18 tests
- 🛡️ Field Support & Security: 21 tests
- 📊 Data Integrity & Performance validated
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets to existing release
if: steps.check_release.outputs.exists == 'true'
run: |
echo "Uploading assets to existing release ${{ github.ref_name }}"
gh release upload ${{ github.ref_name }} \
super-layout-table-${{ github.ref_name }}.tar.gz \
--clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}