@darco2903/cdn-api 1.0.7-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,116 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*" # Trigger on version tags
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: write
11
+
12
+ env:
13
+ PNPM_VERSION: "10.32.0"
14
+ TARBALL_NAME: "darco2903-cdn-api"
15
+
16
+ jobs:
17
+ check:
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v5
23
+
24
+ - name: Check tag matches package.json version
25
+ run: |
26
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
27
+ PKG_VERSION=$(node -p "require('./package.json').version")
28
+ PNPM_VERSION=$(node -p "require('./package.json').packageManager.split('@')[1]")
29
+
30
+ echo "Tag version: $TAG_VERSION"
31
+ echo "Package version: $PKG_VERSION"
32
+
33
+ if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
34
+ echo "❌ Tag version does not match package.json version"
35
+ exit 1
36
+ fi
37
+
38
+ if [ "$PNPM_VERSION" != "${{ env.PNPM_VERSION }}" ]; then
39
+ echo "❌ package.json specifies pnpm version $PNPM_VERSION, expected ${{ env.PNPM_VERSION }}"
40
+ exit 1
41
+ fi
42
+
43
+ #
44
+
45
+ test:
46
+ needs: check
47
+ runs-on: ${{ matrix.os }}
48
+
49
+ strategy:
50
+ matrix:
51
+ os: [ubuntu-latest]
52
+ node-version: [24]
53
+
54
+ steps:
55
+ - name: Checkout code
56
+ uses: actions/checkout@v5
57
+
58
+ - name: Install pnpm
59
+ uses: pnpm/action-setup@v4
60
+ with:
61
+ version: "${{ env.PNPM_VERSION }}"
62
+
63
+ - name: Use Node.js ${{ matrix.node-version }}
64
+ uses: actions/setup-node@v4
65
+ with:
66
+ node-version: ${{ matrix.node-version }}
67
+ cache: "pnpm"
68
+
69
+ - name: Install dependencies
70
+ run: pnpm install --frozen-lockfile
71
+
72
+ - name: Run tests
73
+ run: pnpm test
74
+
75
+ #
76
+
77
+ release:
78
+ needs: [check, test]
79
+ runs-on: ubuntu-latest
80
+
81
+ strategy:
82
+ matrix:
83
+ node-version: [24]
84
+
85
+ steps:
86
+ - name: Checkout code
87
+ uses: actions/checkout@v5
88
+
89
+ - name: Install pnpm
90
+ uses: pnpm/action-setup@v4
91
+ with:
92
+ version: "${{ env.PNPM_VERSION }}"
93
+
94
+ - name: Use Node.js ${{ matrix.node-version }}
95
+ uses: actions/setup-node@v4
96
+ with:
97
+ node-version: ${{ matrix.node-version }}
98
+ cache: "pnpm"
99
+
100
+ - name: Install dependencies
101
+ run: pnpm install --frozen-lockfile
102
+
103
+ - name: Pack project
104
+ run: pnpm pack
105
+
106
+ - name: Upload release asset
107
+ uses: softprops/action-gh-release@v2
108
+ with:
109
+ files: "${{ env.TARBALL_NAME }}-*.tgz"
110
+ generate_release_notes: true
111
+ env:
112
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113
+
114
+ - name: Publish to NPM
115
+ shell: bash
116
+ run: pnpm publish --access public --no-git-checks