@automateinc/fleet-types 1.0.33 → 1.0.35

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.
@@ -1,21 +1,54 @@
1
1
  name: Publish Package to npmjs
2
+
2
3
  on:
3
4
  push:
4
- branches: ["main"]
5
+ branches:
6
+ - "**" # all branches
7
+
5
8
  jobs:
6
- build:
9
+ publish:
7
10
  runs-on: ubuntu-latest
8
11
  permissions:
9
12
  contents: read
10
13
  id-token: write
14
+
11
15
  steps:
12
16
  - uses: actions/checkout@v4
13
- # Setup .npmrc file to publish to npm
17
+
14
18
  - uses: actions/setup-node@v4
15
19
  with:
16
20
  node-version: '20.x'
17
21
  registry-url: 'https://registry.npmjs.org'
22
+
23
+ - run: npm install -g semver
24
+
25
+ - name: Bump version
26
+ id: bump
27
+ run: |
28
+ PACKAGE_NAME=$(jq -r .name package.json)
29
+ LATEST_VERSION=$(npm view "$PACKAGE_NAME" version || echo "0.0.0")
30
+ echo "Latest version: $LATEST_VERSION"
31
+ BASE_VERSION=$(semver -i patch "$LATEST_VERSION")
32
+
33
+ if [[ "${{ github.ref_name }}" == "main" ]]; then
34
+ FINAL_VERSION="$BASE_VERSION"
35
+ else
36
+ SHORT_SHA=$(git rev-parse --short HEAD)
37
+ FINAL_VERSION="${BASE_VERSION}-dev.$SHORT_SHA"
38
+ fi
39
+
40
+ echo "Final version: $FINAL_VERSION"
41
+ jq ".version = \"$FINAL_VERSION\"" package.json > package.tmp.json
42
+ mv package.tmp.json package.json
43
+
44
+ echo "version=$FINAL_VERSION" >> $GITHUB_OUTPUT
45
+
18
46
  - run: npm ci
19
- - run: npm publish --provenance --access public
47
+
48
+ - name: Publish to npm
49
+ run: npm publish --provenance --access public --tag $( [[ "${{ github.ref_name }}" == "main" ]] && echo "latest" || echo "dev" )
20
50
  env:
21
51
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52
+
53
+ - name: Output Published Version
54
+ run: 'echo "📦 Published version: ${{ steps.bump.outputs.version }}"'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@automateinc/fleet-types",
3
3
  "private": false,
4
- "version": "1.0.33",
4
+ "version": "1.0.35",
5
5
  "description": "Reusable TypeScript types and interfaces for Fleet API.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/types/index.d.ts",