@devopsplaybook.io/otel-utils-fastify 1.0.15 → 1.0.16
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.
|
@@ -7,72 +7,9 @@ on:
|
|
|
7
7
|
workflow_dispatch:
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- name: Setup Node.js
|
|
17
|
-
uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: "18"
|
|
20
|
-
cache: "npm"
|
|
21
|
-
|
|
22
|
-
- name: Install dependencies
|
|
23
|
-
run: npm ci
|
|
24
|
-
|
|
25
|
-
- name: Run linting
|
|
26
|
-
run: npm run lint || echo "No lint script found, skipping"
|
|
27
|
-
|
|
28
|
-
- name: Run tests
|
|
29
|
-
run: npm test || echo "No test script found, skipping"
|
|
30
|
-
|
|
31
|
-
- name: Build package
|
|
32
|
-
run: npm run build
|
|
33
|
-
|
|
34
|
-
publish-release:
|
|
35
|
-
runs-on: ubuntu-latest
|
|
36
|
-
needs: test-and-build
|
|
37
|
-
|
|
38
|
-
steps:
|
|
39
|
-
- uses: actions/checkout@v4
|
|
40
|
-
with:
|
|
41
|
-
fetch-depth: 0 # Need full history for version comparison
|
|
42
|
-
|
|
43
|
-
- name: Setup Node.js
|
|
44
|
-
uses: actions/setup-node@v4
|
|
45
|
-
with:
|
|
46
|
-
node-version: "18"
|
|
47
|
-
cache: "npm"
|
|
48
|
-
registry-url: "https://registry.npmjs.org"
|
|
49
|
-
|
|
50
|
-
- name: Install dependencies
|
|
51
|
-
run: npm ci
|
|
52
|
-
|
|
53
|
-
- name: Build package
|
|
54
|
-
run: npm run build
|
|
55
|
-
|
|
56
|
-
- name: Check if version changed
|
|
57
|
-
id: version-check
|
|
58
|
-
run: |
|
|
59
|
-
# Get current version from package.json
|
|
60
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
61
|
-
echo "current-version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
|
|
62
|
-
|
|
63
|
-
# Check if this version exists on npm
|
|
64
|
-
if npm view @devopsplaybook.io/otel-utils-fastify@${CURRENT_VERSION} version &> /dev/null; then
|
|
65
|
-
echo "version-exists=true" >> $GITHUB_OUTPUT
|
|
66
|
-
echo "Version ${CURRENT_VERSION} already exists on npm"
|
|
67
|
-
else
|
|
68
|
-
echo "version-exists=false" >> $GITHUB_OUTPUT
|
|
69
|
-
echo "Version ${CURRENT_VERSION} is new, will publish"
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
- name: Publish release package
|
|
73
|
-
if: steps.version-check.outputs.version-exists == 'false'
|
|
74
|
-
run: |
|
|
75
|
-
echo "Publishing version ${{ steps.version-check.outputs.current-version }}"
|
|
76
|
-
npm publish
|
|
77
|
-
env:
|
|
78
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
10
|
+
npm-merge:
|
|
11
|
+
uses: devopsplaybook-io/common-utils/.github/workflows/reusable-npm-merge.yml@main
|
|
12
|
+
with:
|
|
13
|
+
npm_package_name: "@devopsplaybook.io/otel-utils-fastify"
|
|
14
|
+
secrets:
|
|
15
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -16,88 +16,9 @@ permissions:
|
|
|
16
16
|
issues: write
|
|
17
17
|
|
|
18
18
|
jobs:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- name: Setup Node.js
|
|
26
|
-
uses: actions/setup-node@v4
|
|
27
|
-
with:
|
|
28
|
-
node-version: "18"
|
|
29
|
-
cache: "npm"
|
|
30
|
-
|
|
31
|
-
- name: Install dependencies
|
|
32
|
-
run: npm ci
|
|
33
|
-
|
|
34
|
-
- name: Run linting
|
|
35
|
-
run: npm run lint || echo "No lint script found, skipping"
|
|
36
|
-
|
|
37
|
-
- name: Run tests
|
|
38
|
-
run: npm test || echo "No test script found, skipping"
|
|
39
|
-
|
|
40
|
-
- name: Build package
|
|
41
|
-
run: npm run build
|
|
42
|
-
|
|
43
|
-
publish-beta:
|
|
44
|
-
runs-on: ubuntu-latest
|
|
45
|
-
needs: test-and-build
|
|
46
|
-
if: github.event_name == 'pull_request'
|
|
47
|
-
|
|
48
|
-
steps:
|
|
49
|
-
- uses: actions/checkout@v4
|
|
50
|
-
|
|
51
|
-
- name: Setup Node.js
|
|
52
|
-
uses: actions/setup-node@v4
|
|
53
|
-
with:
|
|
54
|
-
node-version: "18"
|
|
55
|
-
cache: "npm"
|
|
56
|
-
registry-url: "https://registry.npmjs.org"
|
|
57
|
-
|
|
58
|
-
- name: Install dependencies
|
|
59
|
-
run: npm ci
|
|
60
|
-
|
|
61
|
-
- name: Build package
|
|
62
|
-
run: npm run build
|
|
63
|
-
|
|
64
|
-
- name: Generate beta version
|
|
65
|
-
id: beta-version
|
|
66
|
-
run: |
|
|
67
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
68
|
-
PR_NUMBER=${{ github.event.pull_request.number }}
|
|
69
|
-
COMMIT_SHA=${GITHUB_SHA:0:7}
|
|
70
|
-
BETA_VERSION="${CURRENT_VERSION}-beta.${PR_NUMBER}.${COMMIT_SHA}"
|
|
71
|
-
echo "version=${BETA_VERSION}" >> $GITHUB_OUTPUT
|
|
72
|
-
echo "Beta version will be: ${BETA_VERSION}"
|
|
73
|
-
|
|
74
|
-
- name: Update package.json with beta version
|
|
75
|
-
run: |
|
|
76
|
-
npm version ${{ steps.beta-version.outputs.version }} --no-git-tag-version
|
|
77
|
-
|
|
78
|
-
- name: Publish beta package
|
|
79
|
-
run: npm publish --tag beta
|
|
80
|
-
env:
|
|
81
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
82
|
-
|
|
83
|
-
- name: Comment PR with beta version info
|
|
84
|
-
uses: actions/github-script@v7
|
|
85
|
-
with:
|
|
86
|
-
script: |
|
|
87
|
-
github.rest.issues.createComment({
|
|
88
|
-
issue_number: context.issue.number,
|
|
89
|
-
owner: context.repo.owner,
|
|
90
|
-
repo: context.repo.repo,
|
|
91
|
-
body: `🚀 **Beta version published!**
|
|
92
|
-
|
|
93
|
-
**Package**: \`@devopsplaybook.io/otel-utils-fastify@${{ steps.beta-version.outputs.version }}\`
|
|
94
|
-
|
|
95
|
-
Install with:
|
|
96
|
-
\`\`\`bash
|
|
97
|
-
npm install @devopsplaybook.io/otel-utils-fastify@${{ steps.beta-version.outputs.version }}
|
|
98
|
-
# or
|
|
99
|
-
npm install @devopsplaybook.io/otel-utils-fastify@beta
|
|
100
|
-
\`\`\`
|
|
101
|
-
|
|
102
|
-
This beta version will be available for testing until the PR is merged.`
|
|
103
|
-
})
|
|
19
|
+
npm-pr:
|
|
20
|
+
uses: devopsplaybook-io/common-utils/.github/workflows/reusable-npm-pr.yml@main
|
|
21
|
+
with:
|
|
22
|
+
npm_package_name: "@devopsplaybook.io/otel-utils-fastify"
|
|
23
|
+
secrets:
|
|
24
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|