-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (66 loc) · 1.92 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (66 loc) · 1.92 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
82
83
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
contents: read
# Required for npm Trusted Publishing (OIDC)
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v6
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
cache: pnpm
package-manager-cache: false
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Verify package version matches tag
run: |
PKG_VERSION="v$(node -p "require('./package.json').version")"
TAG_VERSION="${GITHUB_REF_NAME}"
echo "Package version: $PKG_VERSION"
echo "Tag version: $TAG_VERSION"
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: package.json ($PKG_VERSION) != tag ($TAG_VERSION)"
exit 1
fi
echo "Version verified."
- name: Upgrade npm for OIDC
run: npm install -g npm@latest
- name: Publish to npm
run: npm publish --access public --provenance --no-git-checks
github-release:
name: Create GitHub Release
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, '-') }}
append_body: true
body: |
## Installation
```bash
npm install -g modular-framework-offline-generator
```
Run the CLI:
```bash
mfog
```