@iconicompany/imarketplacetypes 1.0.5 → 1.0.7

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.
@@ -28,8 +28,8 @@ jobs:
28
28
 
29
29
  - name: Bump version
30
30
  run: |
31
- git config user.name "github-actions"
32
- git config user.email "github-actions@github.com"
31
+ git config --global user.name "github-actions"
32
+ git config --global user.email "github-actions@github.com"
33
33
  npm version patch --force
34
34
 
35
35
  - name: Publish to NPM
@@ -39,6 +39,4 @@ jobs:
39
39
 
40
40
  - name: Commit and push
41
41
  run: |
42
- git config user.name "github-actions"
43
- git config user.email "github-actions@github.com"
44
42
  git push
@@ -4,24 +4,48 @@ on:
4
4
  release:
5
5
  types: [created]
6
6
 
7
+ permissions:
8
+ contents: write # нужно для пуша
9
+
7
10
  jobs:
8
11
  publish-npm:
9
12
  runs-on: ubuntu-latest
10
13
  steps:
11
14
  - uses: actions/checkout@v3
15
+ with:
16
+ # Checkout the branch where the release was created, not the tag
17
+ ref: ${{ github.event.release.target_commitish }}
12
18
  - uses: actions/setup-node@v3
13
19
  with:
14
20
  node-version: 20
15
21
  registry-url: https://registry.npmjs.org/
16
- - name: Extract tag name
17
- id: get_version
18
- run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
19
- - name: Update package.json
22
+ - name: Install dependencies
23
+ run: npm ci
24
+ - name: Build
25
+ run: npm run build
26
+ - name: Bump version to release tag
27
+ id: bump_version
20
28
  run: |
21
- VERSION=${{ steps.get_version.outputs.VERSION }}
22
- sed -i "s/\"version\": \"1.0.0\"/\"version\": \"$VERSION\"/" package.json
23
- - run: npm ci
24
- - run: npm run build
25
- - run: npm publish
29
+ git config --global user.name "github-actions"
30
+ git config --global user.email "github-actions@github.com"
31
+ # GITHUB_REF is in format refs/tags/<tag_name>, we want the tag name
32
+ VERSION=${GITHUB_REF#refs/tags/}
33
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
34
+ # Use npm version to update package.json and package-lock.json
35
+ # --no-git-tag-version prevents it from creating a commit or tag
36
+ npm version $VERSION --no-git-tag-version --allow-same-version
37
+ - name: Publish to NPM
38
+ run: npm publish --access public
26
39
  env:
27
40
  NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
41
+ - name: Commit and push version bump
42
+ run: |
43
+ # Commit the changes made by npm version
44
+ git add package.json package-lock.json
45
+ # Check if there are changes to commit
46
+ if git diff --staged --quiet; then
47
+ echo "Version already up to date."
48
+ else
49
+ git commit -m "chore(release): bump version to ${{ steps.bump_version.outputs.version }}"
50
+ git push
51
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iconicompany/imarketplacetypes",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/index.js",