-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease-workflow.yml
More file actions
81 lines (65 loc) · 2.38 KB
/
Copy pathrelease-workflow.yml
File metadata and controls
81 lines (65 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Production Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Build and Publish Release
id: build
uses: wgtechlabs/package-build-flow-action@v2
with:
# Publish to both registries
registry: 'both'
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
package-scope: '@myorg' # Optional - if not provided, uses repository owner
# Build configuration
build-script: 'build'
# Security - fail on vulnerabilities for production
audit-enabled: 'true'
audit-level: 'high'
fail-on-audit: 'true'
# No PR comments for releases
pr-comment-enabled: 'false'
- name: Display Release Results
run: |
echo "✅ Release published successfully!"
echo "📦 Version: ${{ steps.build.outputs.package-version }}"
echo "🏷️ Flow Type: ${{ steps.build.outputs.build-flow-type }}"
echo "📤 NPM Published: ${{ steps.build.outputs.npm-published }}"
echo "📤 GitHub Published: ${{ steps.build.outputs.github-published }}"
echo ""
echo "📥 Installation:"
echo "${{ steps.build.outputs.registry-urls }}"
- name: Create Release Notes
run: |
cat << EOF > release-notes.md
# Release ${{ steps.build.outputs.package-version }}
## Installation
### NPM Registry
\`\`\`bash
npm install mypackage@${{ steps.build.outputs.package-version }}
\`\`\`
### GitHub Packages
\`\`\`bash
npm install @myorg/mypackage@${{ steps.build.outputs.package-version }}
\`\`\`
## Security
- ✅ Security audit passed
- 🔒 Vulnerabilities: ${{ steps.build.outputs.total-vulnerabilities }}
---
Published: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
EOF
cat release-notes.md