@static-suite/static-suite-data-server 2.0.8 → 2.0.13

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.
@@ -0,0 +1,53 @@
1
+ # Publish whenever a tag is pushed
2
+ name: Publish
3
+
4
+ on:
5
+ push:
6
+ tags: v*
7
+ workflow_dispatch:
8
+ workflow_run:
9
+ workflows: ['Update dependencies']
10
+ types:
11
+ - completed
12
+
13
+ permissions:
14
+ packages: write
15
+ contents: write
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ node-version: [26]
23
+ # permissions:
24
+ # contents: read
25
+ # id-token: write
26
+ steps:
27
+ - name: Check out repository
28
+ uses: actions/checkout@v7
29
+
30
+ - name: Set up Node ${{ matrix.node-version }}
31
+ uses: actions/setup-node@v7
32
+ with:
33
+ node-version: ${{ matrix.node-version }}
34
+ registry-url: 'https://registry.npmjs.org'
35
+
36
+ - name: Install dependencies
37
+ run: yarn install --frozen-lockfile
38
+
39
+ - name: Build
40
+ run: yarn build
41
+
42
+ - name: Test
43
+ run: yarn test --ci --silent
44
+
45
+ - name: Publish to NPM
46
+ run: npm publish --access public
47
+
48
+ - name: Create a Github Release
49
+ env:
50
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
+ run: |
52
+ VERSION=$(node -p "require('./package.json').version")
53
+ gh release create v$VERSION -t "v${VERSION}" --generate-notes
@@ -8,6 +8,7 @@ on:
8
8
 
9
9
  permissions:
10
10
  contents: write
11
+ actions: write
11
12
 
12
13
  jobs:
13
14
  update:
@@ -31,16 +32,32 @@ jobs:
31
32
  run: yarn upgrade
32
33
 
33
34
  - name: Commit files
35
+ id: commit
34
36
  run: |
35
37
  if [ -z "$(git status --porcelain)" ]; then
36
38
  echo "No changes detected, nothing to commit."
39
+ echo "changed=false" >> "$GITHUB_OUTPUT"
37
40
  exit 0
38
41
  fi
39
42
 
40
- echo "Changes detected, committing them."
43
+ # echo "Changes detected, running building and testing."
44
+ yarn build
45
+ yarn test --ci --silent
46
+
47
+ echo "Committing changes."
41
48
  git config user.name "github-actions[bot]"
42
49
  git config user.email "{user.id}+{user.login}[bot]@users.noreply.github.com"
50
+ npm version patch --no-git-tag-version
51
+ VERSION=$(node -p "require('./package.json').version")
43
52
  git add -A
44
- git commit -m "chore: update dependencies"
45
- npm version patch -m "chore: version %s"
46
- git push
53
+ git commit -m "chore: version v$VERSION" --no-verify
54
+ git tag "v$VERSION"
55
+ git push --atomic origin main "v$VERSION"
56
+
57
+ echo "changed=true" >> "$GITHUB_OUTPUT"
58
+
59
+ - name: Trigger publish-to-npm workflow
60
+ if: steps.commit.outputs.changed == 'true'
61
+ env:
62
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+ run: gh workflow run publish-to-npm.yml
package/.husky/pre-commit CHANGED
@@ -1,2 +1 @@
1
1
  yarn build
2
- yarn test --ci --silent
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.59.4"
8
+ "packageVersion": "7.60.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@static-suite/static-suite-data-server",
3
- "version": "2.0.8",
3
+ "version": "2.0.13",
4
4
  "description": "A flexible, fast and developer friendly Data Server for Static Suite",
5
5
  "main": "./dist/lib/index.js",
6
6
  "typings": "./dist/lib/index.d.ts",
@@ -1,35 +0,0 @@
1
- # Publish to npm whenever a tag is pushed
2
- name: Publish to NPM
3
-
4
- on:
5
- push:
6
- tags: v*
7
- workflow_dispatch:
8
-
9
- jobs:
10
- build:
11
- runs-on: ubuntu-latest
12
- strategy:
13
- matrix:
14
- node-version: [26]
15
- permissions:
16
- contents: read
17
- id-token: write
18
- steps:
19
- - name: Check out repository
20
- uses: actions/checkout@v7
21
-
22
- - name: Set up Node ${{ matrix.node-version }}
23
- uses: actions/setup-node@v7
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
- registry-url: 'https://registry.npmjs.org'
27
-
28
- - name: Install dependencies
29
- run: yarn install --frozen-lockfile
30
-
31
- - name: Run tests
32
- run: yarn test
33
-
34
- - name: Publish to NPM
35
- run: npm publish --access public