pmpact 0.4.8 → 0.4.9

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,80 @@
1
+ name: Release and Publish
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ test:
10
+ uses: ./.github/workflows/test.yml
11
+
12
+ release:
13
+ needs: test
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: write
17
+ id-token: write
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+ token: ${{ secrets.GITHUB_TOKEN }}
23
+
24
+ - name: Setup Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: "24"
28
+ registry-url: "https://registry.npmjs.org"
29
+
30
+ - name: Configure Git
31
+ run: |
32
+ git config user.name "github-actions[bot]"
33
+ git config user.email "github-actions[bot]@users.noreply.github.com"
34
+
35
+ - name: Install dependencies
36
+ run: npm ci
37
+
38
+ - name: Get version from package.json
39
+ id: version
40
+ run: |
41
+ VERSION=$(jq -r .version package.json)
42
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
43
+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
44
+ echo "Version from package.json: $VERSION"
45
+
46
+ - name: Check if tag exists
47
+ id: check_tag
48
+ run: |
49
+ if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
50
+ echo "exists=true" >> $GITHUB_OUTPUT
51
+ echo "⚠️ Tag v${{ steps.version.outputs.version }} already exists, skipping release"
52
+ else
53
+ echo "exists=false" >> $GITHUB_OUTPUT
54
+ echo "✅ Tag v${{ steps.version.outputs.version }} does not exist, proceeding with release"
55
+ fi
56
+
57
+ - name: Create and push tag
58
+ if: steps.check_tag.outputs.exists == 'false'
59
+ run: |
60
+ git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
61
+ git push origin "v${{ steps.version.outputs.version }}"
62
+
63
+ - name: Publish to npm
64
+ if: steps.check_tag.outputs.exists == 'false'
65
+ run: npm publish --provenance --access public
66
+
67
+ - name: Create GitHub Release
68
+ if: steps.check_tag.outputs.exists == 'false'
69
+ uses: actions/create-release@v1
70
+ env:
71
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72
+ with:
73
+ tag_name: ${{ steps.version.outputs.tag }}
74
+ release_name: Release ${{ steps.version.outputs.tag }}
75
+ body: |
76
+ Automated release created from commit: ${{ github.sha }}
77
+
78
+ See [CHANGELOG](https://github.com/${{ github.repository }}/compare/${{ steps.version.outputs.tag }}) for details.
79
+ draft: false
80
+ prerelease: false
@@ -0,0 +1,24 @@
1
+ name: Run Test and Checks
2
+ on:
3
+ pull_request:
4
+ branches: [main]
5
+ workflow_call:
6
+ jobs:
7
+ run-tests:
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ matrix:
11
+ node-version: [24]
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Setup Node.js
15
+ uses: actions/setup-node@v4
16
+ with:
17
+ node-version: "24"
18
+ registry-url: "https://registry.npmjs.org"
19
+ - name: Install dependencies
20
+ run: npm ci
21
+ - name: Audit dependencies
22
+ run: npm audit --prod --audit-level critical
23
+ - name: Run tests
24
+ run: npm test
@@ -0,0 +1,28 @@
1
+ name: Check Version Exists
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ version-check:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ fetch-depth: 0
14
+ - name: Check if version tag exists
15
+ run: |
16
+ CURRENT_VERSION=$(jq -r .version package.json)
17
+ TAG_NAME="v$CURRENT_VERSION"
18
+
19
+ git fetch --tags
20
+
21
+ if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
22
+ echo "❌ Error: Tag $TAG_NAME already exists!"
23
+ echo "This version has already been released."
24
+ echo "Please bump to a newer version in package.json."
25
+ exit 1
26
+ fi
27
+
28
+ echo "Tag $TAG_NAME does not exist yet - ready for release"
package/README.md CHANGED
@@ -23,7 +23,7 @@ A command line tool to convert [_Pact_](https://docs.pact.io/) files to [_Postma
23
23
 
24
24
  ## Requirements
25
25
 
26
- Requires [_NodeJS_](https://nodejs.org/en/) version `v20.11` or higher.
26
+ Requires [_NodeJS_](https://nodejs.org/en/) version `v24.13` or higher.
27
27
 
28
28
  ## Installation
29
29
 
package/RELEASE.md CHANGED
@@ -6,6 +6,17 @@
6
6
  > [!NOTE]
7
7
  > The following process is primarily aimed at internal contributors. However, if you wish to contribute to this repository you are more than welcome; please do reach out and open a PR.
8
8
 
9
+
10
+ ## Automated Release Checks ( Recommended )
11
+
12
+ - Once your changes are ready to be merged into `main` branch, open a PR.
13
+ - You must bump the version in `package.json`. The [Version Check GitHub Action](.github/workflows/version-check.yml) will verify that the version tag does not already exist.
14
+ - [Tests](.github/workflows/test.yml) will run automatically via GitHub Actions for each commit in the PR.
15
+ - Once approved, `squash and merge` the PR into `main` branch.
16
+ - Once merged the [Release GitHub Action](.github/workflows/release.yml) will automatically publish the new version to [npm](https://www.npmjs.com/).
17
+
18
+ ## Manual Release Process
19
+
9
20
  Follow this release process:
10
21
 
11
22
  1. Make your changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmpact",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "A command line tool to convert Pact files to Postman collections.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "convert"
22
22
  ],
23
23
  "engines": {
24
- "node": ">=20.11"
24
+ "node": ">=24.13"
25
25
  },
26
26
  "author": "Romuald Quantin (ITV)",
27
27
  "license": "SEE LICENSE IN LICENSE.md",